Commit 6e12581b by Nayeli Monserrat Velasco Lopez

Merge branch 'nayeli.velasco' into 'master'

UI home See merge request !4
parents b4463ec2 b3bc340f
...@@ -13,8 +13,8 @@ class MyApp extends StatelessWidget { ...@@ -13,8 +13,8 @@ class MyApp extends StatelessWidget {
return MaterialApp( return MaterialApp(
title: 'Flutter Demo', title: 'Flutter Demo',
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
initialRoute: 'login', // Ruta inicial initialRoute: 'login',
routes: getApplicationRoutes(), // Definición de rutas routes: getApplicationRoutes(),
); );
} }
} }
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class HomePage extends StatelessWidget { void main() => runApp(const DrawerApp());
const HomePage({Key? key}) : super(key: key);
class DrawerApp extends StatelessWidget {
const DrawerApp({super.key});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return MaterialApp(
appBar: AppBar( theme: ThemeData(useMaterial3: true),
title: const Text('Home Page'), home: const HomePage(),
), );
body: Center( }
child: ElevatedButton( }
onPressed: () {
Navigator.pushNamed(context, 'articles'); class HomePage extends StatefulWidget {
}, const HomePage({super.key});
child: const Text('Hola home_page'),
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
String selectedPage = '';
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 2, // Número de pestañas
child: Scaffold(
appBar: AppBar(
title: const Text('Home Page'),
backgroundColor: Colors.blue,
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: const Icon(Icons.menu),
onPressed: () {
Scaffold.of(context).openDrawer();
},
);
},
),
bottom: const TabBar(
tabs: [
Tab(icon: Icon(Icons.home), text: 'Categoria'),
Tab(icon: Icon(Icons.person_2_outlined), text: 'Perfil'),
],
),
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
const DrawerHeader(
decoration: BoxDecoration(
color: Colors.blue,
),
child: Text(
'Menu App',
style: TextStyle(
color: Colors.white,
fontSize: 24,
),
),
),
ListTile(
leading: const Icon(Icons.message),
title: const Text('Mensajes'),
onTap: () {
setState(() {
selectedPage = 'Messages';
});
Navigator.pop(context); // Close the drawer
},
),
ListTile(
leading: const Icon(Icons.settings),
title: const Text('Configuraciones'),
onTap: () {
setState(() {
selectedPage = 'Settings';
});
Navigator.pop(context); // Close the drawer
},
),
],
),
),
body: TabBarView(
children: [
Center(child: Text('Tab 1 Contenido')),
Center(child: Text('Tab 2 Contenido')),
],
), ),
), ),
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment