From f62ba505872790715092f91484c28ecaec2b5977 Mon Sep 17 00:00:00 2001 From: Giovanna Esmeralda Chavez Espino <79319097+gio-gigi@users.noreply.github.com> Date: Tue, 7 May 2024 11:44:52 -0600 Subject: [PATCH] Se agrego el response de login --- fronted/aplicacionrutasturisticas/lib/config/dio.dart | 11 +++++++++++ .../aplicacionrutasturisticas/lib/pages/login.dart | 2 ++ 2 files changed, 13 insertions(+) diff --git a/fronted/aplicacionrutasturisticas/lib/config/dio.dart b/fronted/aplicacionrutasturisticas/lib/config/dio.dart index 501bfac..5bc2d6d 100644 --- a/fronted/aplicacionrutasturisticas/lib/config/dio.dart +++ b/fronted/aplicacionrutasturisticas/lib/config/dio.dart @@ -13,4 +13,15 @@ void Registro_Datos(String nombre, String lastname, String email, "email": email, }); print(response.data.toString()); + + +} +void loginDatos(String email, String password) async { + Response responselogin; + responselogin = await dio.post("http://192.168.1.81:3000/auth-user/login", data: { + "email": email, + "password": password, + }); + print(responselogin.data.toString()); } + diff --git a/fronted/aplicacionrutasturisticas/lib/pages/login.dart b/fronted/aplicacionrutasturisticas/lib/pages/login.dart index 2df5bed..0a04239 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/login.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/login.dart @@ -1,3 +1,4 @@ +import 'package:aplicacionrutasturisticas/config/dio.dart'; import 'package:aplicacionrutasturisticas/utilerias/TextButtons.dart'; import 'package:flutter/material.dart'; @@ -78,6 +79,7 @@ class _TextFielEjemploState extends State { corr = correo.text; pass = password.text; print(corr + " " + pass); + loginDatos(corr, pass); } void botonRegistrar() { -- GitLab