diff --git a/lib/main.dart b/lib/main.dart index 5a1dd86..a379f1f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -13,7 +13,7 @@ class MyApp extends StatelessWidget { Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, - title: 'Flutter Demo', + title: 'Practica Flutter', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), useMaterial3: true, @@ -25,21 +25,3 @@ class MyApp extends StatelessWidget { } } -class MyWidget extends StatelessWidget { - const MyWidget({super.key}); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( // Barra que se encuentra en la parte superior - title: Text("Prueba flutter estamo en el main "), // Agregar titulo en appBar - backgroundColor: Colors.lightBlue, // Agregar color en la appBar - actions: const [ // Agregar iconos - Icon(Icons.search), - Icon(Icons.menu) - ], - ), - body: Column(children: []), // Va a tener varios hijos - ); - } -} diff --git a/lib/src/pages/login_page.dart b/lib/src/pages/login_page.dart index de54fb5..ef59142 100644 --- a/lib/src/pages/login_page.dart +++ b/lib/src/pages/login_page.dart @@ -1,35 +1,60 @@ import 'package:flutter/material.dart'; -class LoginPage extends StatelessWidget { +class LoginPage extends StatefulWidget { const LoginPage({Key? key}) : super(key: key); @override + _LoginPageState createState() => _LoginPageState(); +} + +class _LoginPageState extends State { + + @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: const Text('Estoy en Login'), - backgroundColor: Colors.lightBlue, // Agregar color en la appBar - actions: const [ // Agregar iconos + title: const Text('Iniciar sesión'), + backgroundColor: Colors.lightBlue, + actions: const [ Icon(Icons.search), Icon(Icons.menu), ], ), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/img/logo_visorus.jpg'), + const SizedBox(height: 20), + + //Campo de Usuario + TextField( + decoration: const InputDecoration( + labelText: 'Usuario', + border: OutlineInputBorder(), + ), + ), + const SizedBox(height: 20), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - // Agrega la imagen local - Image.asset('assets/img/logo_visorus.jpg',height: 100), - // Botón para navegar a la página 'homeSeller' - ElevatedButton( - onPressed: () { - // Navega a la página 'homeSeller' cuando se presiona el botón. - Navigator.pushNamed(context, 'homeSeller'); - }, - child: const Text('Avanzar a Home'), - ), - ], + //Campo de contraseña + TextField( + decoration: const InputDecoration( + labelText: 'Contraseña', + border: OutlineInputBorder(), + ), + obscureText: true, + ), + const SizedBox(height: 20), + ElevatedButton( + onPressed: () { + Navigator.pushNamed(context, 'homeSeller'); + }, + child: const Text('Acceder'), + ), + ], + ), ), ), );