Commit 78e21345 by Nayeli Monserrat Velasco Lopez

Merge branch 'nayeli.velasco' into 'master'

UI home con boton See merge request !5
parents 6e12581b cf5c4977
...@@ -24,6 +24,16 @@ class HomePage extends StatefulWidget { ...@@ -24,6 +24,16 @@ class HomePage extends StatefulWidget {
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
String selectedPage = ''; String selectedPage = '';
void _handleNewCategory() {
// Define la acción que debe ocurrir cuando se presiona el botón "Nueva categoria"
setState(() {
selectedPage = 'Nueva categoria';
});
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('Nueva categoria presionada')),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DefaultTabController( return DefaultTabController(
...@@ -75,7 +85,6 @@ class _HomePageState extends State<HomePage> { ...@@ -75,7 +85,6 @@ class _HomePageState extends State<HomePage> {
Navigator.pop(context); // Close the drawer Navigator.pop(context); // Close the drawer
}, },
), ),
ListTile( ListTile(
leading: const Icon(Icons.settings), leading: const Icon(Icons.settings),
title: const Text('Configuraciones'), title: const Text('Configuraciones'),
...@@ -91,7 +100,23 @@ class _HomePageState extends State<HomePage> { ...@@ -91,7 +100,23 @@ class _HomePageState extends State<HomePage> {
), ),
body: TabBarView( body: TabBarView(
children: [ children: [
Center(child: Text('Tab 1 Contenido')), Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Center(
),
),
Padding(
padding: const EdgeInsets.all(50.0),
child: ElevatedButton(
onPressed: _handleNewCategory,
child: const Text('Nueva categoria'),
),
),
],
),
Center(child: Text('Tab 2 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