28 lines
690 B
Dart
28 lines
690 B
Dart
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
import 'package:http/http.dart' as http;
|
|
import 'package:html/parser.dart' as htmlParser;
|
|
import 'package:html/dom.dart' as htmlDom;
|
|
import 'package:flutter_project/pages/embalses';
|
|
|
|
// 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';
|
|
}
|
|
} |