From 020decf51299d8b242fd938ad0c13f09588fae58 Mon Sep 17 00:00:00 2001 From: Angel David Carlos Silva Date: Tue, 7 May 2024 12:48:50 -0600 Subject: [PATCH 1/3] Agregando la paguina de inicio --- .../lib/pages/start_page.dart | 31 +++++++++++++++++++ .../lib/utilerias/Images.dart | 24 ++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 fronted/aplicacionrutasturisticas/lib/pages/start_page.dart create mode 100644 fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart diff --git a/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart b/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart new file mode 100644 index 0000000..86e89a5 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart @@ -0,0 +1,31 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class started_page extends StatefulWidget { + @override + startedPage createState() => startedPage(); +} + +class startedPage extends State { + final String nombre = "Pancho"; + final String bienvenida = "Bienvenido !"; + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: SizedBox( + child: Text(bienvenida), + ), + ), + body: Center( + child: SingleChildScrollView( + child: Column( + children: [], + ), + ), + ), + ), + ); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart new file mode 100644 index 0000000..763408c --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart @@ -0,0 +1,24 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class imagesWhitText_Network extends StatelessWidget { + final String imageURL; + final String text; + const imagesWhitText_Network( + {Key? key, required this.text, required this.imageURL}) + : super(key: key); + @override + Widget build(BuildContext context) { + return InkWell( + child: Stack( + children: [ + Image.network( + imageURL, + scale: 5, + ), + Text("") + ], + ), + ); + } +} -- GitLab From fd3a095fe4c2ffe0d8e9b290fc6bbf253f35c81e Mon Sep 17 00:00:00 2001 From: Angel David Carlos Silva Date: Tue, 7 May 2024 12:52:14 -0600 Subject: [PATCH 2/3] Agregando paguina de inicio --- .../lib/config/router.dart | 9 ++- .../lib/pages/login.dart | 1 + .../lib/pages/start_page.dart | 67 ++++++++++++++++--- .../lib/utilerias/Images.dart | 29 ++++++-- 4 files changed, 90 insertions(+), 16 deletions(-) diff --git a/fronted/aplicacionrutasturisticas/lib/config/router.dart b/fronted/aplicacionrutasturisticas/lib/config/router.dart index d4e435c..64e46e1 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: '/', + 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 0a04239..9515dd5 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/login.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/login.dart @@ -80,6 +80,7 @@ class _TextFielEjemploState extends State { 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 index 86e89a5..03c6412 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart @@ -1,31 +1,82 @@ -import 'package:flutter/cupertino.dart'; +import 'package:aplicacionrutasturisticas/utilerias/Images.dart'; import 'package:flutter/material.dart'; -class started_page extends StatefulWidget { +class StartedPage extends StatefulWidget { + const StartedPage({super.key}); + @override - startedPage createState() => startedPage(); + StartedPageState createState() => StartedPageState(); } -class startedPage extends State { +class StartedPageState extends State { final String nombre = "Pancho"; final String bienvenida = "Bienvenido !"; + @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( - title: SizedBox( - child: Text(bienvenida), - ), + title: Text(bienvenida), ), body: Center( child: SingleChildScrollView( child: Column( - children: [], + children: [ + Column( + 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), + Column( + 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 Lista de Lugares"); + } } diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart index 763408c..e7a9f00 100644 --- a/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart @@ -1,22 +1,37 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class imagesWhitText_Network extends StatelessWidget { +class ImagesWithTextNetwork extends StatelessWidget { final String imageURL; final String text; - const imagesWhitText_Network( - {Key? key, required this.text, required this.imageURL}) - : super(key: key); + 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: Stack( + alignment: Alignment.center, children: [ Image.network( imageURL, - scale: 5, + fit: BoxFit.cover, ), - Text("") + Container( + color: Colors.black54, + child: Text( + text, + style: TextStyle( + color: Colors.white, + ), + ), + ) ], ), ); -- GitLab From 680b340ecc4107c2d957bd67c4438d89c213467a Mon Sep 17 00:00:00 2001 From: Angel David Carlos Silva Date: Tue, 7 May 2024 13:28:55 -0600 Subject: [PATCH 3/3] Modificando inicio pague --- .../lib/config/router.dart | 2 +- .../lib/pages/login.dart | 2 +- .../lib/pages/start_page.dart | 8 ++-- .../lib/utilerias/Images.dart | 41 ++++++++++--------- 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/fronted/aplicacionrutasturisticas/lib/config/router.dart b/fronted/aplicacionrutasturisticas/lib/config/router.dart index 64e46e1..5c03c71 100644 --- a/fronted/aplicacionrutasturisticas/lib/config/router.dart +++ b/fronted/aplicacionrutasturisticas/lib/config/router.dart @@ -21,7 +21,7 @@ final GoRouter router = GoRouter(routes: [ ]), GoRoute( name: "StartPage", - path: '/', + 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 9515dd5..f67ee89 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/login.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/login.dart @@ -79,7 +79,7 @@ class _TextFielEjemploState extends State { corr = correo.text; pass = password.text; print(corr + " " + pass); - loginDatos(corr, pass); + context.goNamed("StartPage"); } diff --git a/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart b/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart index 03c6412..8ce5533 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/start_page.dart @@ -1,5 +1,7 @@ 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}); @@ -23,7 +25,7 @@ class StartedPageState extends State { child: SingleChildScrollView( child: Column( children: [ - Column( + Row( mainAxisAlignment: MainAxisAlignment.center, children: [ ImagesWithTextNetwork( @@ -40,7 +42,7 @@ class StartedPageState extends State { ], ), const SizedBox(height: 30), - Column( + Row( mainAxisAlignment: MainAxisAlignment.center, children: [ ImagesWithTextNetwork( @@ -77,6 +79,6 @@ class StartedPageState extends State { } void buttonRutasCompletadas() { - print("Haz precionado Lista de Lugares"); + print("Haz precionado Rutas Recomendadas"); } } diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart index e7a9f00..b567b0d 100644 --- a/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Images.dart @@ -15,25 +15,28 @@ class ImagesWithTextNetwork extends StatelessWidget { @override Widget build(BuildContext context) { return InkWell( - onTap: onTap, - child: Stack( - alignment: Alignment.center, - children: [ - Image.network( - imageURL, - fit: BoxFit.cover, - ), - Container( - color: Colors.black54, - child: Text( - text, - style: TextStyle( - color: Colors.white, + 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, + ), + ), + ) + ], + ), + )); } } -- GitLab