diff --git a/fronted/aplicacionrutasturisticas/lib/config/dio.dart b/fronted/aplicacionrutasturisticas/lib/config/dio.dart index a583352765f7a8134eee70567bf92432db827bb3..1d44319b122fbae7c06f3f0fd3581ce172920fa6 100644 --- a/fronted/aplicacionrutasturisticas/lib/config/dio.dart +++ b/fronted/aplicacionrutasturisticas/lib/config/dio.dart @@ -5,13 +5,13 @@ void Registro_Datos(String nombre, String lastname, String email, String phone, String password) async { Response response; //response = await dio.get("http://172.26.128.1:3000") - response = await dio.post("http://10.2.81.72:3000/auth-user/register", data: { + response = + await dio.post("http://172.31.128.1:3000/auth-user/register", data: { "name": nombre, "lastname": lastname, "password": password, "email": email, "phone": phone, - }); print(response.data.toString()); } diff --git a/fronted/aplicacionrutasturisticas/lib/config/router.dart b/fronted/aplicacionrutasturisticas/lib/config/router.dart index 67485c3e069d8abd7c05014313a80943a72859bf..d4e435c4d4df43c1bcafa6d23ca1f2d338fb1b04 100644 --- a/fronted/aplicacionrutasturisticas/lib/config/router.dart +++ b/fronted/aplicacionrutasturisticas/lib/config/router.dart @@ -13,7 +13,7 @@ final GoRouter router = GoRouter(routes: [ routes: [ GoRoute( name: "RegisterPage", - path: "/registerlogin", + path: "registerlogin", builder: (BuildContext context, GoRouterState state) { return const RegistroPage(); }) diff --git a/fronted/aplicacionrutasturisticas/lib/main.dart b/fronted/aplicacionrutasturisticas/lib/main.dart index 098762319c59099ce84a4c40a27e2ec96db040c3..066ade613b52752b234f225377b92259b40bff9e 100644 --- a/fronted/aplicacionrutasturisticas/lib/main.dart +++ b/fronted/aplicacionrutasturisticas/lib/main.dart @@ -1,3 +1,4 @@ +import 'package:aplicacionrutasturisticas/config/router.dart'; import 'package:flutter/material.dart'; import 'package:aplicacionrutasturisticas/pages/login.dart'; import 'package:aplicacionrutasturisticas/pages/register.dart'; @@ -9,16 +10,6 @@ void main() { class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { - return MaterialApp( - debugShowCheckedModeBanner: false, - theme: ThemeData( - primarySwatch: Colors.indigo, - visualDensity: VisualDensity.adaptivePlatformDensity, - ), - initialRoute: RegistroPage.id, - routes: { - RegistroPage.id: (_) => const RegistroPage(), - }, - ); + return MaterialApp.router(routerConfig: router); } } diff --git a/fronted/aplicacionrutasturisticas/lib/pages/login.dart b/fronted/aplicacionrutasturisticas/lib/pages/login.dart index e19a4c272ba199a60736f20796932736bb7723d6..2df5bed76388c689398f5d736a3e72d32bc44749 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/login.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/login.dart @@ -1,7 +1,9 @@ +import 'package:aplicacionrutasturisticas/utilerias/TextButtons.dart'; import 'package:flutter/material.dart'; import 'package:aplicacionrutasturisticas/utilerias/Buttons.dart'; import 'package:aplicacionrutasturisticas/utilerias/Textfields.dart'; +import 'package:go_router/go_router.dart'; class TextFielEjemploLogin extends StatefulWidget { const TextFielEjemploLogin({super.key}); @@ -57,7 +59,13 @@ class _TextFielEjemploState extends State { child: boton_Escribir( texto: "Iniciar sesiĆ³n", onPression: botonIniciaSesion, - )) + )), + SizedBox(height: 20), + ColoredBox( + color: Colors.white, + child: HacerTextButtons( + texto: "Registrarte", onPression: botonRegistrar), + ) ], ), ), @@ -71,4 +79,8 @@ class _TextFielEjemploState extends State { pass = password.text; print(corr + " " + pass); } + + void botonRegistrar() { + context.goNamed("RegisterPage"); + } }