Cambio de imagen y funcion launchAemet integrada
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
// Define el estado
|
||||
class MyState {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Define el bloc
|
||||
@ -10,3 +11,11 @@ class MyBloc extends Cubit<MyState> {
|
||||
MyBloc() : super(MyState());
|
||||
|
||||
}
|
||||
Future<void> launchAemetURL() async {
|
||||
const url = 'https://www.aemet.es/es/eltiempo/prediccion/municipios/caspe-id50074';
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
} else {
|
||||
throw 'Could not launch $url';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user