Cambio interfaz home (prueba), error en enlace Tiempo y noticias faltan mejoras
This commit is contained in:
@ -37,12 +37,16 @@ Future<List<String>> obtenerDatos(String url) async {
|
||||
}
|
||||
|
||||
Future<void> launchAemetURL() async {
|
||||
const urlString = 'https://www.aemet.es/es/eltiempo/prediccion/municipios/caspe-id50074';
|
||||
final url = Uri.parse(urlString);
|
||||
const urlString = 'https://www.aemet.es/es/eltiempo/prediccion/municipios/caspe-id50074';
|
||||
final url = Uri.parse(urlString);
|
||||
|
||||
if (await canLaunchUrl(url)) {
|
||||
await launchUrl(url);
|
||||
} else {
|
||||
throw 'Could not launch $urlString';
|
||||
}
|
||||
try {
|
||||
if (await canLaunch(urlString)) {
|
||||
await launch(urlString);
|
||||
} else {
|
||||
throw 'Could not launch $urlString';
|
||||
}
|
||||
} catch (e) {
|
||||
throw Exception('Error al lanzar la URL de Aemet: $e');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user