From f1ac7ea57d740702379f0bfb025d5705d974d911 Mon Sep 17 00:00:00 2001 From: Angel David Carlos Silva Date: Tue, 23 Apr 2024 10:07:40 -0600 Subject: [PATCH] agregando registro --- .vscode/launch.json | 28 ++++++ .../lib/pages/login.dart | 23 +++-- .../lib/pages/register.dart | 88 +++++++++++++++++++ .../lib/utilerias/Buttons.dart | 32 +++++++ .../lib/utilerias/Textfields.dart | 46 ++++++++++ 5 files changed, 204 insertions(+), 13 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 fronted/aplicacionrutasturisticas/lib/pages/register.dart create mode 100644 fronted/aplicacionrutasturisticas/lib/utilerias/Buttons.dart create mode 100644 fronted/aplicacionrutasturisticas/lib/utilerias/Textfields.dart diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..893af74 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,28 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "aplicacionrutasturisticas", + "cwd": "fronted\\aplicacionrutasturisticas", + "request": "launch", + "type": "dart" + }, + { + "name": "aplicacionrutasturisticas (profile mode)", + "cwd": "fronted\\aplicacionrutasturisticas", + "request": "launch", + "type": "dart", + "flutterMode": "profile" + }, + { + "name": "aplicacionrutasturisticas (release mode)", + "cwd": "fronted\\aplicacionrutasturisticas", + "request": "launch", + "type": "dart", + "flutterMode": "release" + } + ] +} \ No newline at end of file diff --git a/fronted/aplicacionrutasturisticas/lib/pages/login.dart b/fronted/aplicacionrutasturisticas/lib/pages/login.dart index f6e8791..e5864ba 100644 --- a/fronted/aplicacionrutasturisticas/lib/pages/login.dart +++ b/fronted/aplicacionrutasturisticas/lib/pages/login.dart @@ -1,33 +1,30 @@ import 'package:flutter/material.dart'; -class LoginPage extends StatelessWidget{ +class LoginPage extends StatelessWidget { static String id = "login_page"; @override - Widget build(BuildContext context){ + Widget build(BuildContext context) { return SafeArea( child: Scaffold( - backgroundColor: Color.fromARGB(0, 255, 255, 255) , + backgroundColor: Color.fromARGB(0, 255, 255, 255), body: Center( - child:Column( + child: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Text( "Login".toUpperCase(), textAlign: TextAlign.center, style: TextStyle( - color: Colors.white, - fontSize: 40, - fontWeight: FontWeight.bold, - fontFamily: 'impact' - ), + color: Colors.white, + fontSize: 40, + fontWeight: FontWeight.bold, + fontFamily: 'impact'), ), SizedBox( height: 20.0, ), Row( - children: [ - - ], + children: [], ) ], ), @@ -35,4 +32,4 @@ class LoginPage extends StatelessWidget{ ), ); } -} \ No newline at end of file +} diff --git a/fronted/aplicacionrutasturisticas/lib/pages/register.dart b/fronted/aplicacionrutasturisticas/lib/pages/register.dart new file mode 100644 index 0000000..01d23f9 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/pages/register.dart @@ -0,0 +1,88 @@ +import 'dart:ui'; + +import 'package:aplicacionrutasturisticas/utilerias/Buttons.dart'; +import 'package:aplicacionrutasturisticas/utilerias/Textfields.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; +import 'package:flutter/services.dart'; + +class TextFielEjemplo extends StatefulWidget { + const TextFielEjemplo({super.key}); + + @override + _TextFielEjemploState createState() => _TextFielEjemploState(); +} + +class _TextFielEjemploState extends State { + @override + Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + appBar: AppBar( + title: SizedBox( + child: Center( + child: Text("Registro", + style: const TextStyle(fontWeight: FontWeight.bold), + selectionColor: Colors.black, + textScaleFactor: lerpDouble(2, 2, 3)))), + ), + //backgroundColor: Colors.black, + body: const Center( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + iconButton(), + SizedBox( + height: 20.0, + ), + hacerTextField(texto: "Nombre/s", ocultar: false), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + hacerTextField( + texto: "Apellidos", + ocultar: false, + ), + ], + ), + SizedBox(height: 20), + ColoredBox( + color: Colors.white, + child: hacerTextField( + texto: "Email", + ocultar: false, + ), + ), + SizedBox( + height: 20, + ), + ColoredBox( + color: Colors.white, + child: hacerTextField( + texto: "Numero de teléfono", ocultar: false)), + SizedBox(height: 20), + ColoredBox( + color: Colors.white, + child: hacerTextField(texto: "Contraseña", ocultar: true)), + SizedBox(height: 20), + ColoredBox( + color: Colors.white, + child: hacerTextField( + texto: "Confirma contraseña", ocultar: true), + ), + SizedBox(height: 20), + ColoredBox( + color: Colors.white, + child: boton_Escribir( + texto: "Registro", + )) + ], + ), + ), + ), + ), + ); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Buttons.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Buttons.dart new file mode 100644 index 0000000..3743a29 --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Buttons.dart @@ -0,0 +1,32 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +class boton_Escribir extends StatefulWidget { + final String texto; + + const boton_Escribir({Key? key, required this.texto}) : super(key: key); + + @override + _BotonEscribirState createState() => _BotonEscribirState(); +} + +class _BotonEscribirState extends State { + Color backgroundColor = Colors.red; + + @override + Widget build(BuildContext context) { + return OutlinedButton( + onPressed: () { + debugPrint("Acabas de hacer click"); + //objectoX; + }, + child: Text(widget.texto), + style: ButtonStyle( + //fixedSize: MaterialStateProperty.all(Size(200, 10)), + foregroundColor: MaterialStateProperty.all(Colors.white), + backgroundColor: MaterialStateProperty.all(backgroundColor), + ), + ); + } +} diff --git a/fronted/aplicacionrutasturisticas/lib/utilerias/Textfields.dart b/fronted/aplicacionrutasturisticas/lib/utilerias/Textfields.dart new file mode 100644 index 0000000..f580b5e --- /dev/null +++ b/fronted/aplicacionrutasturisticas/lib/utilerias/Textfields.dart @@ -0,0 +1,46 @@ +import 'dart:ui'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +class hacerTextField extends StatelessWidget { + final String texto; + final bool ocultar; + const hacerTextField({Key? key, required this.texto, required this.ocultar}) + : super(key: key); + @override + Widget build(BuildContext context) { + return SizedBox( + width: 250, + child: TextField( + cursorColor: Colors.purple, + style: const TextStyle( + color: Color.fromARGB(255, 0, 0, 0), + ), + obscureText: ocultar, + decoration: InputDecoration( + border: const OutlineInputBorder(), + labelText: texto, + ), + ), + ); + } +} + +class iconButton extends StatelessWidget { + const iconButton({super.key}); + + @override + Widget build(BuildContext context) { + return GestureDetector( + child: Image.network( + "https://i.ibb.co/9Vpn7vW/imagen-2024-04-23-010203690.png", + scale: 5, + ), + onTap: () { + debugPrint("Has hecho click en el icono"); + }, + ); + } +} -- GitLab