Commit b3bc340f by nayeli92433

UI home

parent 4c05db99
......@@ -13,8 +13,8 @@ class MyApp extends StatelessWidget {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
initialRoute: 'login', // Ruta inicial
routes: getApplicationRoutes(), // Definición de rutas
initialRoute: 'login',
routes: getApplicationRoutes(),
);
}
}
import 'package:flutter/material.dart';
class HomePage extends StatelessWidget {
const HomePage({Key? key}) : super(key: key);
void main() => runApp(const DrawerApp());
class DrawerApp extends StatelessWidget {
const DrawerApp({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
return MaterialApp(
theme: ThemeData(useMaterial3: true),
home: const HomePage(),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({super.key});
@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'),
),
body: Center(
child: ElevatedButton(
backgroundColor: Colors.blue,
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: const Icon(Icons.menu),
onPressed: () {
Navigator.pushNamed(context, 'articles');
Scaffold.of(context).openDrawer();
},
);
},
child: const Text('Hola home_page'),
),
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