import 'package:flutter/material.dart'; import 'package:practica1_flutter/src/pages/category/category_widget.dart'; // Asegúrate de importar la página de categorías import 'package:practica1_flutter/src/pages/category_form.dart'; // Asegúrate de importar la página del formulario class HomeSellerPage extends StatelessWidget { const HomeSellerPage({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return DefaultTabController( length: 2, child: Scaffold( appBar: AppBar( title: const Text("ShopMaster"), centerTitle: true, foregroundColor: Colors.white, backgroundColor: Colors.indigoAccent, bottom: const TabBar( tabs: [ Tab(icon: Icon(Icons.article_outlined), text: "Artículos"), Tab(icon: Icon(Icons.category), text: "Categorías"), ], ), ), drawer: MenuLateral(), body: TabBarView( children: [ CategoryWidget(), // Página de categorías ], ), floatingActionButton: FloatingActionButton( onPressed: () { Navigator.pushNamed(context, 'category_form'); }, child: Icon(Icons.add), tooltip: 'Agregar Categoría', // Mensaje para el botón ), ), ); } } // Clase del menú lateral class MenuLateral extends StatelessWidget { @override Widget build(BuildContext context) { return Drawer( child: ListView( children: [ const UserAccountsDrawerHeader( accountName: Text("Efren David"), accountEmail: Text("24mdavid25@gmail.com"), ), Ink( color: Colors.indigo, child: ListTile( title: const Text("Mi cuenta", style: TextStyle(color: Colors.white)), ), ), const ListTile( title: Text("Categorías"), ), const ListTile( title: Text("Configuración"), ), ], ), ); } }