"Añadidas politicas de privacidad en la pantalla principal"
This commit is contained in:
@ -49,3 +49,14 @@ Future<void> launchAemetURL() async {
|
|||||||
throw Exception('Error al lanzar la URL de Aemet: $e');
|
throw Exception('Error al lanzar la URL de Aemet: $e');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> launchPrivacyPolicyURL() async {
|
||||||
|
const urlString = 'https://crcivan.asociacionador.es/politica-privacidad.html';
|
||||||
|
final url = Uri.parse(urlString);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await launch(urlString);
|
||||||
|
} catch (e) {
|
||||||
|
throw Exception('Error al lanzar la URL de la política de privacidad: $e');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:crcivan/pages/noticias';
|
|||||||
import 'package:crcivan/pages/pregon';
|
import 'package:crcivan/pages/pregon';
|
||||||
import 'package:crcivan/pages/embalses';
|
import 'package:crcivan/pages/embalses';
|
||||||
import 'package:crcivan/widgets/background_widget.dart';
|
import 'package:crcivan/widgets/background_widget.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
class MyHomePage extends StatelessWidget {
|
class MyHomePage extends StatelessWidget {
|
||||||
const MyHomePage({super.key, required this.title});
|
const MyHomePage({super.key, required this.title});
|
||||||
@ -15,17 +16,22 @@ class MyHomePage extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: const CustomAppBar(), //Barra superior personalizada
|
appBar: const CustomAppBar(), //Barra superior personalizada
|
||||||
body: BackgroundWidget( //Widget fondo del fichero BackgroundWidget
|
body: BackgroundWidget(
|
||||||
|
//Widget fondo del fichero BackgroundWidget
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () { Navigator.push(
|
onTap: () {
|
||||||
context,
|
Navigator.push(
|
||||||
MaterialPageRoute(builder: (context) => const NoticiasPage()),
|
context,
|
||||||
);},
|
MaterialPageRoute(
|
||||||
child: SizedBox( //Botón Noticias
|
builder: (context) => const NoticiasPage()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
child: SizedBox(
|
||||||
|
//Botón Noticias
|
||||||
width: 300.0,
|
width: 300.0,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20.0),
|
padding: const EdgeInsets.only(bottom: 20.0),
|
||||||
@ -55,7 +61,8 @@ class MyHomePage extends StatelessWidget {
|
|||||||
MaterialPageRoute(builder: (context) => const Pregon()),
|
MaterialPageRoute(builder: (context) => const Pregon()),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: SizedBox(//Botón Pregón
|
child: SizedBox(
|
||||||
|
//Botón Pregón
|
||||||
width: 300.0,
|
width: 300.0,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20.0),
|
padding: const EdgeInsets.only(bottom: 20.0),
|
||||||
@ -82,10 +89,12 @@ class MyHomePage extends StatelessWidget {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.push(
|
Navigator.push(
|
||||||
context,
|
context,
|
||||||
MaterialPageRoute(builder: (context) => const EmbalsesPage()),
|
MaterialPageRoute(
|
||||||
|
builder: (context) => const EmbalsesPage()),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: SizedBox( //Botón Embalses
|
child: SizedBox(
|
||||||
|
//Botón Embalses
|
||||||
width: 300.0,
|
width: 300.0,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20.0),
|
padding: const EdgeInsets.only(bottom: 20.0),
|
||||||
@ -110,9 +119,10 @@ class MyHomePage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
InkWell(
|
InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
launchAemetURL();//Función a link externo
|
launchAemetURL(); //Función a link externo
|
||||||
},
|
},
|
||||||
child: SizedBox(//Botón Tiempo
|
child: SizedBox(
|
||||||
|
//Botón Tiempo
|
||||||
width: 300.0,
|
width: 300.0,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(bottom: 20.0),
|
padding: const EdgeInsets.only(bottom: 20.0),
|
||||||
@ -135,11 +145,26 @@ class MyHomePage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SizedBox(height: 20),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
launchPrivacyPolicyURL();
|
||||||
|
},
|
||||||
|
child: const Text(
|
||||||
|
'Lee nuestras políticas de privacidad',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.blue,
|
||||||
|
decoration: TextDecoration.underline,
|
||||||
|
fontSize: 16.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
bottomNavigationBar: const CustomBottomBar(),//Barra inferior personalizada
|
bottomNavigationBar:
|
||||||
|
const CustomBottomBar(), //Barra inferior personalizada
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user