diff --git a/lib/src/pages/home_page.dart b/lib/src/pages/home_page.dart index 989f30b..7e6f716 100644 --- a/lib/src/pages/home_page.dart +++ b/lib/src/pages/home_page.dart @@ -1,29 +1,68 @@ import 'package:flutter/material.dart'; class HomePage extends StatelessWidget { - const HomePage({Key? key}) : super(key: key); // Constructor + const HomePage({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( // Barra de aplicaciones - title: const Text('Home Page'), // Título de la barra + appBar: AppBar( + title: const Text('Home'), + backgroundColor: Colors.blue, + actions: [ + IconButton( + icon: const Icon(Icons.search), + onPressed: (){ + + }, + ) + ], ), - body: Center( // Centra el contenido - child: Column( // Dispone los hijos en una columna - mainAxisAlignment: MainAxisAlignment.center, // Centra verticalmente - children: [ // Lista de hijos - const Text('Hola home page'), // Texto - const SizedBox(height: 20), // Tamaño del texto - ElevatedButton( // Botón - onPressed: () { // Acción al presionar - Navigator.pushNamed(context, 'articles'); // Navega a 'articles' + drawer: Drawer( + child: ListView( + padding: EdgeInsets.zero, + children: [ + const DrawerHeader( + decoration: BoxDecoration( + color: Colors.blue, + ), + child: Text('Menu'), + ), + ListTile( + title: const Text('Configuraciones'), + ), + ListTile( + title: const Text('Ayuda'), + ), + ListTile( + title: const Text('Exit'), + ), + ], + ), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text('Hola home page'), + const SizedBox(height: 20), + ElevatedButton( + onPressed: () { + Navigator.pushNamed(context, 'articles'); }, - child: const Text('Ir a Articles Page'), // Texto del botón + child: const Text('Ir a Articles Page'), ), ], ), ), + floatingActionButton: FloatingActionButton( + onPressed: () { + Navigator.pushNamed(context, 'login'); + }, + child: const Icon(Icons.add), + tooltip: 'Agregar categoria', + ), + floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, ); } } diff --git a/lib/src/pages/login_page.dart b/lib/src/pages/login_page.dart index dc5282b..a1a43a7 100644 --- a/lib/src/pages/login_page.dart +++ b/lib/src/pages/login_page.dart @@ -5,7 +5,7 @@ class LoginPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Scaffold( + return Scaffold( appBar: AppBar( // Barra de aplicaciones en la parte superior title: const Text('Login Page'), // Título de la barra ),