diff --git a/fronted/aplicacionrutasturisticas/lib/config/router.dart b/fronted/aplicacionrutasturisticas/lib/config/router.dart index d4e435c4d4df43c1bcafa6d23ca1f2d338fb1b04..5c03c71b2869d6b351eece0ba296b37340708e5a 100644 --- a/fronted/aplicacionrutasturisticas/lib/config/router.dart +++ b/fronted/aplicacionrutasturisticas/lib/config/router.dart @@ -1,5 +1,6 @@ import 'package:aplicacionrutasturisticas/pages/login.dart'; import 'package:aplicacionrutasturisticas/pages/register.dart'; +import 'package:aplicacionrutasturisticas/pages/start_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:go_router/go_router.dart'; @@ -17,5 +18,11 @@ final GoRouter router = GoRouter(routes: [ builder: (BuildContext context, GoRouterState state) { return const RegistroPage(); }) - ]) + ]), + GoRoute( + name: "StartPage", + path: '/startpage', + builder: (BuildContext context, GoRouterState state) { + return const StartedPage(); + }) ]); diff --git a/fronted/aplicacionrutasturisticas/lib/pages/login.dart b/fronted/aplicacionrutasturisticas/lib/pages/login.dart index 0a042391f8139b980aeda4f31690678b68a34cbf..f67ee8990ed810522cb8862596174a4ee173c295 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/login.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/login.dart @@ -79,7 +79,8 @@ class _TextFielEjemploState extends State { corr = correo.text; pass = password.text; print(corr + " " + pass); - loginDatos(corr, pass); + + context.goNamed("StartPage"); } void botonRegistrar() { diff --git a/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart b/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart new file mode 100644 index 0000000000000000000000000000000000000000..8ce553333194b819e64c970632859cc90ae43480 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart @@ -0,0 +1,84 @@ +import 'package:aplicacionrutasturisticas/utilerias/Images.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +class StartedPage extends StatefulWidget { + const StartedPage({super.key}); + + @override + StartedPageState createState() => StartedPageState(); +} + +class StartedPageState extends State { + final String nombre = "Pancho"; + final String bienvenida = "Bienvenido !"; + + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: Text(bienvenida), + ), + body: Center( + child: SingleChildScrollView( + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ImagesWithTextNetwork( + text: "Crear Ruta", + onTap: buttonCrearRuta, + imageURL: + "https://www.eluniversal.com.mx/resizer/cyelyPh4C4pSbIBjHdO0WSF8FSs=/1100x666/cloudfront-us-east-1.images.arcpublishing.com/eluniversal/DWSWJNA4B5HDBKAXYD6YTFUUUI.jpg"), + const SizedBox(width: 20), + ImagesWithTextNetwork( + text: "Ruta Recomendada", + onTap: buttonRutaRecomendada, + imageURL: + "https://assets.turismocity.com/cdn-cgi/image/format=auto,width=500,fit=scale-down/ruta-40-argentina.jpeg") + ], + ), + const SizedBox(height: 30), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + ImagesWithTextNetwork( + text: "Lista de Lugares", + onTap: buttonListadeLugares, + imageURL: + "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQhuG72NEweDkbylMmq7Mh3MSI0orCC4Xupsg&usqp=CAU"), + const SizedBox(width: 20), + ImagesWithTextNetwork( + text: "Rutas Completadas", + onTap: buttonRutasCompletadas, + imageURL: + "https://static.vecteezy.com/system/resources/previews/015/954/844/non_2x/all-systems-are-ready-tasks-completed-conditions-met-full-readiness-fact-check-series-of-correct-decisions-implementation-of-roadmap-agreement-compliance-with-criteria-fulfill-all-requirements-photo.jpg") + ], + ) + ], + ), + ), + ), + ), + ); + } + + void buttonCrearRuta() { + print("Haz presionado Crear Ruta"); + } + + void buttonRutaRecomendada() { + print("Haz presionado Ruta Recomendada"); + } + + void buttonListadeLugares() { + print("Haz precionado Lista de Lugares"); + } + + void buttonRutasCompletadas() { + print("Haz precionado Rutas Recomendadas"); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart new file mode 100644 index 0000000000000000000000000000000000000000..b567b0d9a749a633af471e00413ef4a210087aea --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart @@ -0,0 +1,42 @@ +import 'package:flutter/material.dart'; + +class ImagesWithTextNetwork extends StatelessWidget { + final String imageURL; + final String text; + final VoidCallback? onTap; + + const ImagesWithTextNetwork({ + Key? key, + required this.text, + required this.onTap, + required this.imageURL, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return InkWell( + onTap: onTap, + child: ClipRRect( + borderRadius: BorderRadius.circular(30), + child: Stack( + alignment: Alignment.center, + children: [ + Image.network( + imageURL, + height: 100, + width: 150, + ), + Container( + color: Colors.black54, + child: Text( + text, + style: TextStyle( + color: Colors.white, + ), + ), + ) + ], + ), + )); + } +}