diff --git a/fronted/aplicacionrutasturisticas/lib/config/dio.dart b/fronted/aplicacionrutasturisticas/lib/config/dio.dart new file mode 100644 index 0000000000000000000000000000000000000000..6b9ecbe9e576003492d1db7b17e152c8727f8099 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/config/dio.dart @@ -0,0 +1,16 @@ +import 'package:dio/dio.dart'; + +final dio = Dio(); +void Registro_Datos(String nombre, String lastname, String email, int phone, + String password) async { + Response response; + response = await dio.post("http://localhost:3306", data: { + 'name': nombre, + 'lastname': lastname, + 'email': email, + 'phone': phone, + 'password': password + }); + print("Hola\n"); + print(response.data.toString()); +} diff --git a/fronted/aplicacionrutasturisticas/lib/pages/register.dart b/fronted/aplicacionrutasturisticas/lib/pages/register.dart index b7e35ca1f2771d5d02c08498185e8a03f9a6b434..9aa7ea2744a95484e3eb136e2f2d5d17244f323f 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/register.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/register.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:aplicacionrutasturisticas/config/dio.dart'; import 'package:aplicacionrutasturisticas/utilerias/Buttons.dart'; import 'package:aplicacionrutasturisticas/utilerias/Textfields.dart'; import 'package:flutter/cupertino.dart'; @@ -108,6 +109,7 @@ class RegistroPageState extends State { } void precionaRegistro() { + int phoneInt = int.parse(pho); nom = nombre.text; ape = apellido.text; ema = email.text; @@ -128,5 +130,11 @@ class RegistroPageState extends State { ' ' + passc + " \n "); + + if (pass == passc) { + Registro_Datos(nom, ape, ema, phoneInt, pass); + } else { + print("La contraseƱa es incorrecta"); + } } } diff --git a/fronted/aplicacionrutasturisticas/pubspec.lock b/fronted/aplicacionrutasturisticas/pubspec.lock index 57599eebfb2dd17ececb4738b6b39030c52ec4d8..894899e3451e6d455d7807b73aec5e4d2b0425fa 100644 --- a/fronted/aplicacionrutasturisticas/pubspec.lock +++ b/fronted/aplicacionrutasturisticas/pubspec.lock @@ -49,6 +49,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.6" + dio: + dependency: "direct main" + description: + name: dio + sha256: "11e40df547d418cc0c4900a9318b26304e665da6fa4755399a9ff9efd09034b5" + url: "https://pub.dev" + source: hosted + version: "5.4.3+1" fake_async: dependency: transitive description: @@ -88,6 +96,14 @@ packages: url: "https://pub.dev" source: hosted version: "13.2.4" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" leak_tracker: dependency: transitive description: @@ -213,6 +229,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" vector_math: dependency: transitive description: diff --git a/fronted/aplicacionrutasturisticas/pubspec.yaml b/fronted/aplicacionrutasturisticas/pubspec.yaml index 3cfaa6406820661da1a9e8f3ad16145b68671a89..a66ab6ae69206e116949624dfa3b774083e78064 100644 --- a/fronted/aplicacionrutasturisticas/pubspec.yaml +++ b/fronted/aplicacionrutasturisticas/pubspec.yaml @@ -36,6 +36,7 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 go_router: ^13.2.4 + dio: ^5.4.3+1 dev_dependencies: flutter_test: