Separacion de codigo por carpetas, cambio de estilo, clase pregon integrada
This commit is contained in:
24
lib/BloC/contenedores_event.dart
Normal file
24
lib/BloC/contenedores_event.dart
Normal file
@ -0,0 +1,24 @@
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
// Define el estado
|
||||
class MyState {
|
||||
|
||||
}
|
||||
|
||||
// Define el bloc
|
||||
class MyBloc extends Cubit<MyState> {
|
||||
MyBloc() : super(MyState());
|
||||
|
||||
}
|
||||
Future<void> launchAemetURL() async {
|
||||
|
||||
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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user