c90Beretta 1 miesiąc temu
rodzic
commit
f676a93737

+ 2 - 0
lib/main.dart

@@ -80,7 +80,9 @@ class MyApp extends StatelessWidget {
       locale: const Locale("en", "ES"),
       debugShowCheckedModeBanner: false,
       title: 'Turquessa',
+      // darkTheme: AppTheme.darkTheme,
       theme: AppTheme.lightTheme,
+      // themeMode: ThemeMode.system,
       initialRoute: 'home',
       routes: {
         'login': (context) => const LoginScreen(),

+ 25 - 0
lib/mvvm/viewmodels/home_view_model.dart

@@ -1,3 +1,5 @@
+import 'dart:ffi';
+
 import 'package:flutter/material.dart';
 import 'package:sqflite/sqflite.dart';
 import '../../core/services/reposit_factory.dart';
@@ -5,6 +7,8 @@ import '../../core/services/services.dart';
 import '../../core/models/models.dart';
 
 class HomeViewModel extends ChangeNotifier {
+  //drawer
+  final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
   final Repository<Producto> productoRepository;
   final Repository<CategoriaProducto> categoriaRepository;
 
@@ -79,6 +83,27 @@ class HomeViewModel extends ChangeNotifier {
     notifyListeners();
   }
 
+  void openDrawer() {
+    print(scaffoldKey.currentState);
+    scaffoldKey.currentState?.openDrawer();
+  }
+
+  void closeDrawer() {
+    scaffoldKey.currentState?.closeDrawer();
+  }
+
+  bool isDrawerOpen() {
+    return scaffoldKey.currentState?.isDrawerOpen ?? false;
+  }
+
+  void toggleDrawer() {
+    if (isDrawerOpen()) {
+      closeDrawer();
+    } else {
+      openDrawer();
+    }
+  }
+
   // void nextPage() {
   //   if (_currentPage < totalPages) {
   //     fetchLocal(page: _currentPage + 1);

+ 30 - 0
lib/mvvm/views/home/cateforias_filter_screen.dart

@@ -0,0 +1,30 @@
+import 'package:animate_do/animate_do.dart';
+import 'package:flutter/material.dart';
+import 'package:turquessa_mesas_hoster/utils/themes.dart';
+
+void mostrarCategoriasBottomSheet(BuildContext context) {
+  showModalBottomSheet(
+      context: context,
+      isScrollControlled: true,
+      backgroundColor: AppTheme.primary,
+      builder: (context) => BounceInUp(
+            duration: const Duration(milliseconds: 450),
+            child: Container(
+              height: MediaQuery.of(context).size.height * 0.7,
+              color: AppTheme.primary,
+              decoration: BoxDecoration(
+                color: AppTheme.secondary,
+                borderRadius: const BorderRadius.only(
+                  topLeft: Radius.circular(25),
+                  topRight: Radius.circular(25),
+                ),
+              ),
+              child: SingleChildScrollView(
+                child: Column(
+                  crossAxisAlignment: CrossAxisAlignment.start,
+                  children: [],
+                ),
+              ),
+            ),
+          ));
+}

+ 117 - 99
lib/mvvm/views/home/categorias_navbar.dart

@@ -1,7 +1,10 @@
 import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
+import 'package:turquessa_mesas_hoster/mvvm/viewmodels/home_view_model.dart';
 
 class CategoriasNavBar extends StatefulWidget {
-  const CategoriasNavBar({super.key});
+  GlobalKey<ScaffoldState> get scaffoldkey => GlobalKey<ScaffoldState>();
+  const CategoriasNavBar({super.key, required});
 
   @override
   State<CategoriasNavBar> createState() => _CategoriasNavBarState();
@@ -9,123 +12,138 @@ class CategoriasNavBar extends StatefulWidget {
 
 class _CategoriasNavBarState extends State<CategoriasNavBar> {
   @override
+  void initState() {
+    super.initState();
+    final homeViewModel = Provider.of<HomeViewModel>(context, listen: false);
+  }
+
+  @override
   Widget build(BuildContext context) {
-    return Column(
-      children: [
-        Container(
-          color: Colors.black,
-          padding: const EdgeInsets.symmetric(vertical: 15),
-          child: Row(
-            children: [
-              const SizedBox(width: 20),
-              const Icon(Icons.search, color: Colors.white, size: 28),
-              const SizedBox(width: 20),
-              const Icon(Icons.menu, color: Colors.white, size: 28),
-              const SizedBox(width: 40),
-              Container(
-                padding: const EdgeInsets.only(bottom: 5),
-                decoration: const BoxDecoration(
-                  border: Border(
-                    bottom: BorderSide(
+    final homeViewModel = Provider.of<HomeViewModel>(context);
+    return SingleChildScrollView(
+      scrollDirection: Axis.horizontal,
+      child: Column(
+        children: [
+          Container(
+            color: Colors.black,
+            padding: const EdgeInsets.symmetric(vertical: 15),
+            child: Row(
+              children: [
+                const SizedBox(width: 20),
+                const Icon(Icons.search, color: Colors.white, size: 28),
+                const SizedBox(width: 20),
+                GestureDetector(
+                    onTap: () {
+                      homeViewModel.openDrawer();
+                    },
+                    child:
+                        const Icon(Icons.menu, color: Colors.white, size: 28)),
+                const SizedBox(width: 40),
+                Container(
+                  padding: const EdgeInsets.only(bottom: 5),
+                  decoration: const BoxDecoration(
+                    border: Border(
+                      bottom: BorderSide(
+                        color: Color.fromARGB(255, 47, 208, 229),
+                        width: 3.0,
+                      ),
+                    ),
+                  ),
+                  child: const Text(
+                    "Café",
+                    style: TextStyle(
                       color: Color.fromARGB(255, 47, 208, 229),
-                      width: 3.0,
+                      fontSize: 18,
+                      fontWeight: FontWeight.bold,
                     ),
                   ),
                 ),
-                child: const Text(
-                  "Café",
+                const SizedBox(width: 40),
+                const Text(
+                  'Bolsa',
                   style: TextStyle(
-                    color: Color.fromARGB(255, 47, 208, 229),
+                    color: Colors.white,
                     fontSize: 18,
                     fontWeight: FontWeight.bold,
                   ),
                 ),
-              ),
-              const SizedBox(width: 40),
-              const Text(
-                'Bolsa',
-                style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 18,
-                  fontWeight: FontWeight.bold,
-                ),
-              ),
-              const SizedBox(width: 40),
-              const Text(
-                'Brunch',
-                style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 18,
-                  fontWeight: FontWeight.bold,
+                const SizedBox(width: 40),
+                const Text(
+                  'Brunch',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 18,
+                    fontWeight: FontWeight.bold,
+                  ),
                 ),
-              ),
-              const SizedBox(width: 40),
-              const Text(
-                'Desserts',
-                style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 18,
-                  fontWeight: FontWeight.bold,
+                const SizedBox(width: 40),
+                const Text(
+                  'Desserts',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 18,
+                    fontWeight: FontWeight.bold,
+                  ),
                 ),
-              ),
-              const SizedBox(width: 40),
-              const Text(
-                'Drinks',
-                style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 18,
-                  fontWeight: FontWeight.bold,
+                const SizedBox(width: 40),
+                const Text(
+                  'Drinks',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 18,
+                    fontWeight: FontWeight.bold,
+                  ),
                 ),
-              ),
-              const SizedBox(width: 40),
-              const Text(
-                'Smoothies',
-                style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 18,
-                  fontWeight: FontWeight.bold,
+                const SizedBox(width: 40),
+                const Text(
+                  'Smoothies',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 18,
+                    fontWeight: FontWeight.bold,
+                  ),
                 ),
-              ),
-              const SizedBox(width: 40),
-              const Text(
-                'Tés',
-                style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 18,
-                  fontWeight: FontWeight.bold,
+                const SizedBox(width: 40),
+                const Text(
+                  'Tés',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 18,
+                    fontWeight: FontWeight.bold,
+                  ),
                 ),
-              ),
-              const SizedBox(width: 40),
-              const Text(
-                'Tisanas',
-                style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 18,
-                  fontWeight: FontWeight.bold,
+                const SizedBox(width: 40),
+                const Text(
+                  'Tisanas',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 18,
+                    fontWeight: FontWeight.bold,
+                  ),
                 ),
-              ),
-              const SizedBox(width: 40),
-              const Text(
-                'Vip',
-                style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 18,
-                  fontWeight: FontWeight.bold,
+                const SizedBox(width: 40),
+                const Text(
+                  'Vip',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 18,
+                    fontWeight: FontWeight.bold,
+                  ),
                 ),
-              ),
-              const SizedBox(width: 40),
-              const Text(
-                'Libros',
-                style: TextStyle(
-                  color: Colors.white,
-                  fontSize: 18,
-                  fontWeight: FontWeight.bold,
+                const SizedBox(width: 40),
+                const Text(
+                  'Libros',
+                  style: TextStyle(
+                    color: Colors.white,
+                    fontSize: 18,
+                    fontWeight: FontWeight.bold,
+                  ),
                 ),
-              ),
-            ],
+              ],
+            ),
           ),
-        ),
-      ],
+        ],
+      ),
     );
   }
 }

+ 10 - 4
lib/mvvm/views/home/home_screen.dart

@@ -8,6 +8,7 @@ import 'package:turquessa_mesas_hoster/mvvm/views/home/categorias_navbar.dart';
 import 'package:turquessa_mesas_hoster/mvvm/viewmodels/home_view_model.dart';
 import 'package:turquessa_mesas_hoster/utils/widgets/modal_infonegaocio.dart';
 import 'package:turquessa_mesas_hoster/mvvm/views/home/producto/producto_screen.dart';
+import 'package:turquessa_mesas_hoster/utils/widgets/widgets.dart';
 
 const List<Map<String, dynamic>> items = [
   {
@@ -124,7 +125,10 @@ class _HomeScreenState extends State<HomeScreen> {
   Widget build(BuildContext context) {
     final homeViewModel = Provider.of<HomeViewModel>(context);
     final pedidoViewModel = Provider.of<ProductoViewModel>(context);
+    final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
     return Scaffold(
+        key: homeViewModel.scaffoldKey,
+        drawer: const CustomDrawer(),
         bottomNavigationBar: BottomAppBar(
             color: Colors.black,
             child: Row(
@@ -132,7 +136,9 @@ class _HomeScreenState extends State<HomeScreen> {
               children: [
                 IconButton(
                   icon: const Icon(Icons.search, color: Colors.white),
-                  onPressed: () {},
+                  onPressed: () {
+                    homeViewModel.openDrawer();
+                  },
                 ),
                 IconButton(
                   icon: const Icon(Icons.menu, color: Colors.white),
@@ -159,6 +165,7 @@ class _HomeScreenState extends State<HomeScreen> {
         body: CustomScrollView(
           slivers: [
             SliverAppBar(
+              automaticallyImplyLeading: false,
               floating: true,
               expandedHeight: 200, // Ajusta la altura para acomodar la imagen
               flexibleSpace: FlexibleSpaceBar(
@@ -184,7 +191,7 @@ class _HomeScreenState extends State<HomeScreen> {
                           borderRadius: BorderRadius.circular(12),
                         ),
                         child: Center(
-                          child: Image.asset('assets/props.png'),
+                          child: Image.asset('assets/logo.png'),
                         ),
                       ),
                       const SizedBox(width: 20),
@@ -252,8 +259,7 @@ class CategoriasSliverChild extends SliverPersistentHeaderDelegate {
   @override
   Widget build(
       BuildContext context, double shrinkOffset, bool overlapsContent) {
-    return SingleChildScrollView(
-        scrollDirection: Axis.horizontal, child: CategoriasNavBar());
+    return CategoriasNavBar();
   }
 
   @override

+ 75 - 73
lib/mvvm/views/home/perfil/perfil_screen.dart

@@ -1,5 +1,6 @@
 import 'package:animate_do/animate_do.dart';
 import 'package:flutter/material.dart';
+import 'package:turquessa_mesas_hoster/utils/themes.dart';
 
 class PerfilScreen extends StatefulWidget {
   const PerfilScreen({super.key});
@@ -19,6 +20,7 @@ class _PerfilScreenState extends State<PerfilScreen> {
           child: Column(
             children: [
               // Banner principal con fondo azul
+              // Banner principal con fondo azul
               Container(
                 width: double.infinity,
                 height: 200,
@@ -29,62 +31,72 @@ class _PerfilScreenState extends State<PerfilScreen> {
                     bottomRight: Radius.circular(20),
                   ),
                 ),
-                child: Stack(
-                  children: [
-                    // Texto del banner
-                    const Positioned(
-                      left: 20,
-                      top: 60,
-                      child: Column(
-                        crossAxisAlignment: CrossAxisAlignment.start,
-                        children: [
-                          Text(
-                            'Bienvenido!',
-                            style: TextStyle(
-                              fontSize: 28,
-                              fontWeight: FontWeight.bold,
-                              color: Colors.white,
+                child: ClipRRect(
+                  // Añadimos ClipRRect para asegurar que nada se salga de los bordes
+                  borderRadius: const BorderRadius.only(
+                    bottomLeft: Radius.circular(20),
+                    bottomRight: Radius.circular(20),
+                  ),
+                  child: Stack(
+                    children: [
+                      // Texto del banner
+                      const Positioned(
+                        left: 20,
+                        top: 60,
+                        child: Column(
+                          crossAxisAlignment: CrossAxisAlignment.start,
+                          children: [
+                            Text(
+                              'Bienvenido!',
+                              style: TextStyle(
+                                fontSize: 28,
+                                fontWeight: FontWeight.bold,
+                                color: Colors.white,
+                              ),
                             ),
-                          ),
-                          SizedBox(height: 8),
-                          Text(
-                            'Visitanos el día de hoy para una oferta \n especial en productos seleccionados',
-                            style: TextStyle(
-                              fontSize: 24,
-                              fontWeight: FontWeight.bold,
-                              color: Colors.white,
+                            SizedBox(height: 8),
+                            Text(
+                              'Visitanos el día de hoy para una oferta \n especial en productos seleccionados',
+                              style: TextStyle(
+                                fontSize: 24,
+                                fontWeight: FontWeight.bold,
+                                color: Colors.white,
+                              ),
                             ),
-                          ),
-                        ],
-                      ),
-                    ),
-                    // Ilustración de personaje con mochila y teléfono
-                    Positioned(
-                      right: 20,
-                      bottom: 0,
-                      child: Image.asset(
-                        'assets/turquessa_prop.jpg',
-                        height: 150,
+                          ],
+                        ),
                       ),
-                    ),
-                    // Icono de bombilla
-                    Positioned(
-                      right: 80,
-                      top: 60,
-                      child: Container(
-                        padding: const EdgeInsets.all(8),
-                        decoration: const BoxDecoration(
-                          color: Colors.yellow,
-                          shape: BoxShape.circle,
+
+                      // Imagen posicionada en la esquina inferior derecha
+                      Positioned(
+                        right: 0,
+                        bottom: 0,
+                        child: Image.asset(
+                          'assets/props.png',
+                          height: 190,
+                          fit: BoxFit.contain,
                         ),
-                        child: const Icon(
-                          Icons.lightbulb,
-                          color: Colors.white,
-                          size: 24,
+                      ),
+
+                      // Icono de bombilla
+                      Positioned(
+                        right: 80,
+                        top: 60,
+                        child: Container(
+                          padding: const EdgeInsets.all(8),
+                          decoration: const BoxDecoration(
+                            color: Colors.yellow,
+                            shape: BoxShape.circle,
+                          ),
+                          child: const Icon(
+                            Icons.lightbulb,
+                            color: Colors.white,
+                            size: 24,
+                          ),
                         ),
                       ),
-                    ),
-                  ],
+                    ],
+                  ),
                 ),
               ),
               //? Informaicon de usuario
@@ -92,9 +104,9 @@ class _PerfilScreenState extends State<PerfilScreen> {
                 padding: const EdgeInsets.only(top: 16),
                 child: Container(
                   width: double.infinity,
-                  padding: EdgeInsets.all(20),
+                  padding: const EdgeInsets.all(20),
                   decoration: BoxDecoration(
-                    color: Color(0xFFF5F5F5),
+                    color: const Color(0xFFF5F5F5),
                     borderRadius: BorderRadius.circular(16),
                   ),
                   child: Row(
@@ -111,38 +123,28 @@ class _PerfilScreenState extends State<PerfilScreen> {
                               style: TextStyle(
                                 fontSize: 22,
                                 fontWeight: FontWeight.bold,
-                                color: Colors.black87,
+                                color: AppTheme.secondary,
                               ),
                             ),
-                            SizedBox(height: 8),
-
+                            const SizedBox(height: 8),
                             // Correo electrónico
                             Text(
-                              'atharva@gmail.com',
-                              style: TextStyle(
-                                fontSize: 16,
-                                color: Colors.black54,
-                              ),
-                            ),
-                            SizedBox(height: 8),
-
-                            // Año académico
-                            Text(
-                              'Year: be',
+                              'yadidelias@gmail.com',
                               style: TextStyle(
                                 fontSize: 16,
-                                color: Colors.black54,
+                                color: AppTheme.secondary,
                               ),
                             ),
-                            SizedBox(height: 12),
+                            const SizedBox(height: 8),
 
                             // Botón de editar
                             GestureDetector(
                               onTap: () {
-                                // Acción para editar el perfil
+                                // Navigator.of(context)
+                                //     .pushNamed('editar-perfil');
                               },
-                              child: Text(
-                                'Edit',
+                              child: const Text(
+                                'Editar',
                                 style: TextStyle(
                                   fontSize: 16,
                                   fontWeight: FontWeight.w500,
@@ -156,8 +158,8 @@ class _PerfilScreenState extends State<PerfilScreen> {
                       Container(
                         width: 80,
                         height: 80,
-                        child: Image.asset(
-                          'assets/user_with_laptop.png',
+                        child: Image.network(
+                          'https://st4.depositphotos.com/9998432/22597/v/450/depositphotos_225976914-stock-illustration-person-gray-photo-placeholder-man.jpg',
                           fit: BoxFit.cover,
                         ),
                       ),

+ 22 - 22
lib/mvvm/views/home/producto/producto_screen.dart

@@ -1,5 +1,7 @@
 import 'package:flutter/material.dart';
+import 'package:turquessa_mesas_hoster/utils/widgets/widgets.dart';
 
+//Modelo provisional
 class Product {
   final String id;
   final String nombre;
@@ -80,7 +82,6 @@ class _ProductScreenState extends State<ProductScreen> {
 
   void _calculateTotalprecio() {
     double baseprecio = widget.product.precio;
-    // Añadir precio del queso si está seleccionado
     if (_toppingsViewKey.currentState?.isQuesoSelected == true) {
       baseprecio += widget.product.cheeseprecio;
     }
@@ -109,9 +110,9 @@ class _ProductScreenState extends State<ProductScreen> {
         height: 110,
         child: Container(
           padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
-          decoration: BoxDecoration(
+          decoration: const BoxDecoration(
             color: Color.fromARGB(255, 47, 208, 229),
-            borderRadius: const BorderRadius.only(
+            borderRadius: BorderRadius.only(
               topLeft: Radius.circular(25),
               topRight: Radius.circular(25),
             ),
@@ -126,7 +127,7 @@ class _ProductScreenState extends State<ProductScreen> {
                   children: [
                     Container(
                       decoration: BoxDecoration(
-                        color: Color.fromARGB(255, 200, 214, 232),
+                        color: const Color.fromARGB(255, 200, 214, 232),
                         borderRadius: BorderRadius.circular(2),
                       ),
                       child: IconButton(
@@ -142,7 +143,7 @@ class _ProductScreenState extends State<ProductScreen> {
                       color: Colors.white,
                       child: Text(
                         quantity.toString(),
-                        style: TextStyle(
+                        style: const TextStyle(
                           color: Colors.black,
                           fontSize: 20,
                           fontWeight: FontWeight.bold,
@@ -150,7 +151,7 @@ class _ProductScreenState extends State<ProductScreen> {
                       ),
                     ),
                     Container(
-                      color: Color.fromARGB(255, 200, 214, 232),
+                      color: const Color.fromARGB(255, 200, 214, 232),
                       child: IconButton(
                         icon: const Icon(Icons.add),
                         onPressed: () => _updateQuantity(quantity + 1),
@@ -165,8 +166,8 @@ class _ProductScreenState extends State<ProductScreen> {
                     const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
                 color: Colors.black,
                 child: Text(
-                  "MXN ${totalprecio.toStringAsFixed(2)}",
-                  style: TextStyle(
+                  "Agregar MXN ${totalprecio.toStringAsFixed(2)}",
+                  style: const TextStyle(
                     color: Colors.white,
                     fontSize: 20,
                     fontWeight: FontWeight.bold,
@@ -196,7 +197,7 @@ class _ProductScreenState extends State<ProductScreen> {
                 ),
               ),
               Container(
-                height: 350,
+                height: 550,
                 width: double.infinity,
                 decoration: BoxDecoration(
                   borderRadius: const BorderRadius.only(
@@ -216,39 +217,39 @@ class _ProductScreenState extends State<ProductScreen> {
             ]),
             const SizedBox(height: 20),
             Padding(
-              padding: EdgeInsets.symmetric(horizontal: 20),
+              padding: const EdgeInsets.symmetric(horizontal: 20),
               child: Column(
                 crossAxisAlignment: CrossAxisAlignment.start,
                 children: [
                   Text(
                     widget.product.nombre,
-                    style: TextStyle(
+                    style: const TextStyle(
                       color: Colors.black,
                       fontSize: 44,
                       fontWeight: FontWeight.bold,
                     ),
                   ),
-                  SizedBox(height: 10),
+                  const SizedBox(height: 10),
                   Text(
                     widget.product.descripcion,
-                    style: TextStyle(
+                    style: const TextStyle(
                       color: Colors.black,
                       fontSize: 26,
                     ),
                   ),
-                  SizedBox(height: 10),
+                  const SizedBox(height: 10),
                   Text(
                     'MXN ${widget.product.precio.toStringAsFixed(2)}',
-                    style: TextStyle(
+                    style: const TextStyle(
                       color: Colors.black,
                       fontSize: 36,
                       fontWeight: FontWeight.bold,
                     ),
                   ),
-                  Divider(
+                  const Divider(
                     height: 2,
                   ),
-                  SizedBox(height: 10),
+                  const SizedBox(height: 10),
                   ToppingsView(
                     key: _toppingsViewKey,
                     product: widget.product,
@@ -287,7 +288,6 @@ class _ToppingsViewState extends State<ToppingsView> {
   bool isCoccionExpanded = false;
   bool isQuesoExpanded = true;
 
-  // Estado para la selección de queso
   bool isQuesoSelected = false;
 
   // Selecciones actuales
@@ -386,12 +386,12 @@ class _ToppingsViewState extends State<ToppingsView> {
                 ),
                 height: 80,
                 child: TextField(
-                  style: TextStyle(color: Colors.black),
+                  style: const TextStyle(color: Colors.black),
                   maxLines: 3,
                   onChanged: (value) {
                     comments = value;
                   },
-                  decoration: InputDecoration(
+                  decoration: const InputDecoration(
                     contentPadding: EdgeInsets.all(12),
                     border: InputBorder.none,
                     hintText: "Agrega instrucciones especiales...",
@@ -601,7 +601,7 @@ class _ToppingsViewState extends State<ToppingsView> {
             Column(
               crossAxisAlignment: CrossAxisAlignment.start,
               children: [
-                Text(
+                const Text(
                   "Queso amarillo",
                   style: TextStyle(
                     color: Colors.black,
@@ -611,7 +611,7 @@ class _ToppingsViewState extends State<ToppingsView> {
                 ),
                 Text(
                   "+ MXN ${widget.product.cheeseprecio.toStringAsFixed(2)}",
-                  style: TextStyle(
+                  style: const TextStyle(
                     color: Colors.black,
                     fontSize: 16,
                   ),

+ 33 - 18
lib/utils/themes.dart

@@ -2,16 +2,17 @@ import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 
 class AppTheme {
+  // Colores base
   static Color primary = const Color(0xFF32D7ED);
   static Color secondary = Colors.black;
   static Color tertiary = const Color(0xFF242424);
   static Color quaternary = const Color(0xFFF1F1F3);
   static Color verde = const Color(0xff248f83);
   static Color rojo = const Color(0xFFF24B59);
+
+  // Tema Claro
   static ThemeData lightTheme = ThemeData.light().copyWith(
-    //Scaffold
     scaffoldBackgroundColor: const Color(0xFFE0E0E0),
-    //Tema de AppBar
     appBarTheme: AppBarTheme(
       color: primary,
       foregroundColor: secondary,
@@ -19,31 +20,45 @@ class AppTheme {
         statusBarColor: primary,
         statusBarIconBrightness: Brightness.dark,
       ),
-      iconTheme: IconThemeData(
-        color: secondary,
-      ),
+      iconTheme: IconThemeData(color: secondary),
     ),
-    //Tema de floatingActionButton
     floatingActionButtonTheme: FloatingActionButtonThemeData(
       backgroundColor: primary,
       foregroundColor: secondary,
     ),
-    //Tema de progressIndicator
     progressIndicatorTheme: ProgressIndicatorThemeData(color: tertiary),
-    //Tema de DatePicker
     datePickerTheme: DatePickerThemeData(
-      inputDecorationTheme: InputDecorationTheme(
-          //labelStyle: GoogleFonts.greatVibes(), // Input label
-          ),
-      backgroundColor: const Color(0xFFDBDBDB), //secondary,
+      backgroundColor: const Color(0xFFDBDBDB),
+      headerBackgroundColor: primary,
+      todayBackgroundColor: const MaterialStatePropertyAll(Color(0xFFDBDBDB)),
+      todayForegroundColor: const MaterialStatePropertyAll(Colors.black),
+      rangePickerBackgroundColor: secondary,
+    ),
+  );
+
+  //  **Tema Oscuro**
+  static ThemeData darkTheme = ThemeData.dark().copyWith(
+    scaffoldBackgroundColor: const Color(0xFF121212),
+    appBarTheme: AppBarTheme(
+      color: tertiary, // Un gris oscuro
+      foregroundColor: Colors.white,
+      systemOverlayStyle: SystemUiOverlayStyle(
+        statusBarColor: tertiary,
+        statusBarIconBrightness: Brightness.light,
+      ),
+      iconTheme: const IconThemeData(color: Colors.white),
+    ),
+    floatingActionButtonTheme: FloatingActionButtonThemeData(
+      backgroundColor: primary,
+      foregroundColor: Colors.black,
+    ),
+    progressIndicatorTheme: ProgressIndicatorThemeData(color: primary),
+    datePickerTheme: DatePickerThemeData(
+      backgroundColor: tertiary,
       headerBackgroundColor: primary,
-      todayBackgroundColor:
-          const MaterialStatePropertyAll(Color(0xFFDBDBDB)), //primary
-      todayForegroundColor:
-          const MaterialStatePropertyAll(Color.fromARGB(255, 0, 0, 0)),
+      todayBackgroundColor: const MaterialStatePropertyAll(Colors.white24),
+      todayForegroundColor: const MaterialStatePropertyAll(Colors.white),
       rangePickerBackgroundColor: secondary,
-      // dayOverlayColor: MaterialStatePropertyAll(primary),
-      //headerHelpStyle: const TextStyle(fontSize: 18),
     ),
   );
 }

+ 298 - 90
lib/utils/widgets/app_drawer.dart

@@ -1,110 +1,318 @@
-// ignore_for_file: must_be_immutable
-
 import 'package:flutter/material.dart';
 import 'package:provider/provider.dart';
-import '../../core/models/models.dart';
-import '../../core/services/services.dart';
-import '../themes.dart';
-import '../../mvvm/viewmodels/login_view_model.dart';
-import 'widgets_components.dart';
+import 'package:turquessa_mesas_hoster/mvvm/viewmodels/home_view_model.dart';
 
-class AppDrawer extends StatelessWidget {
-  AppDrawer({super.key});
-
-  Future<bool> _showExitConfirmationDialog(BuildContext context) async {
-    bool shouldPop = false;
-    await showDialog(
-      context: context,
-      builder: (context) => AlertDialog(
-        surfaceTintColor: AppTheme.secondary,
-        title: const Text('¿Cerrar sesión?'),
-        content: const Text('¿Estás seguro de que quieres cerrar la sesión?'),
-        actions: [
-          TextButton(
-            onPressed: () => Navigator.of(context).pop(false),
-            child: const Text('Cancelar', style: TextStyle(color: Colors.red)),
-          ),
-          TextButton(
-            onPressed: () async {
-              Provider.of<LoginViewModel>(context, listen: false).logOut();
-              Navigator.of(context).pushNamedAndRemoveUntil(
-                'login',
-                (route) => false,
-              );
-            },
-            child: const Text('Aceptar'),
-          ),
-        ],
-      ),
-    );
-    return shouldPop;
-  }
+class CustomDrawer extends StatelessWidget {
+  const CustomDrawer({Key? key}) : super(key: key);
 
   @override
   Widget build(BuildContext context) {
-    BaseService baseService = BaseService();
-    String prefijoVersion = baseService.prefijoVersion();
     return Drawer(
-      surfaceTintColor: Colors.white,
-      backgroundColor: Colors.white,
-      child: Column(
-        children: [
-          Container(
-            width: double.infinity,
-            decoration: BoxDecoration(
-              color: AppTheme.primary,
-            ),
-            padding: EdgeInsets.only(
-              top: MediaQuery.of(context).padding.top,
-            ),
-            child: const Column(
-              children: [
-                Padding(
-                  padding: EdgeInsets.all(8.0),
-                  child: Image(
-                    image: AssetImage('assets/logo-BN.png'),
-                    height: 150,
-                  ),
+      child: Container(
+        color: Colors.white,
+        child: ListView(
+          padding: EdgeInsets.zero,
+          children: [
+            // Cabecera del drawer
+            DrawerHeader(
+              decoration: const BoxDecoration(
+                color: Colors.blue,
+                borderRadius: BorderRadius.only(
+                  bottomLeft: Radius.circular(20),
+                  bottomRight: Radius.circular(20),
                 ),
-                SizedBox(
-                  height: 10,
+              ),
+              padding: EdgeInsets.zero,
+              margin: EdgeInsets.zero,
+              child: Stack(
+                children: [
+                  const Positioned(
+                    left: 20,
+                    top: 40,
+                    child: Column(
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                      children: [
+                        Text(
+                          'Menú',
+                          style: TextStyle(
+                            fontSize: 28,
+                            fontWeight: FontWeight.bold,
+                            color: Colors.white,
+                          ),
+                        ),
+                        SizedBox(height: 8),
+                        Text(
+                          'Opciones disponibles',
+                          style: TextStyle(
+                            fontSize: 16,
+                            color: Colors.white,
+                          ),
+                        ),
+                      ],
+                    ),
+                  ),
+                  // Icono decorativo
+                  Positioned(
+                    right: 20,
+                    top: 40,
+                    child: Container(
+                      padding: const EdgeInsets.all(8),
+                      decoration: const BoxDecoration(
+                        color: Colors.yellow,
+                        shape: BoxShape.circle,
+                      ),
+                      child: const Icon(
+                        Icons.menu_book,
+                        color: Colors.white,
+                        size: 24,
+                      ),
+                    ),
+                  ),
+                ],
+              ),
+            ),
+
+            // Tarjeta de perfil del usuario
+            Padding(
+              padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+              child: Container(
+                width: double.infinity,
+                padding: const EdgeInsets.all(20),
+                decoration: BoxDecoration(
+                  color: const Color(0xFFF5F5F5),
+                  borderRadius: BorderRadius.circular(16),
                 ),
-                SizedBox(
-                  height: 10,
+                child: Row(
+                  crossAxisAlignment: CrossAxisAlignment.center,
+                  children: [
+                    Expanded(
+                      child: Column(
+                        crossAxisAlignment: CrossAxisAlignment.start,
+                        children: [
+                          const Text(
+                            'Usuario Conocido',
+                            style: TextStyle(
+                              fontSize: 22,
+                              fontWeight: FontWeight.bold,
+                              color: Colors.black87,
+                            ),
+                          ),
+                          const SizedBox(height: 8),
+                          const Text(
+                            'usuario@gmail.com',
+                            style: TextStyle(
+                              fontSize: 16,
+                              color: Colors.black54,
+                            ),
+                          ),
+                          const SizedBox(height: 12),
+                          GestureDetector(
+                            onTap: () {
+                              // Acción al pulsar en Ver perfil
+                            },
+                            child: const Text(
+                              'Ver perfil',
+                              style: TextStyle(
+                                fontSize: 16,
+                                fontWeight: FontWeight.w500,
+                                color: Colors.blue,
+                              ),
+                            ),
+                          ),
+                        ],
+                      ),
+                    ),
+                    Container(
+                      width: 60,
+                      height: 60,
+                      decoration: BoxDecoration(
+                        shape: BoxShape.circle,
+                        color: Colors.grey[200],
+                      ),
+                      child: const Icon(
+                        Icons.person,
+                        size: 36,
+                        color: Colors.blue,
+                      ),
+                    ),
+                  ],
                 ),
-              ],
+              ),
             ),
-          ),
-          // HEADER
-          Expanded(
-            child: ListView(
-              children: [
-                ListTile(
-                  leading: circulo(const Icon(Icons.restaurant_menu)),
-                  title: const Text('Pedidos'),
-                  onTap: () => {},
+
+            // Opciones del menú
+            _buildMenuItem(
+              icon: Icons.home_outlined,
+              title: "Inicio",
+              onTap: () {
+                Navigator.pop(context);
+                // Navegación a la pantalla de inicio
+              },
+            ),
+
+            _buildMenuItem(
+              icon: Icons.shopping_bag_outlined,
+              title: "Mis Pedidos",
+              onTap: () {
+                Navigator.pop(context);
+                // Navegación a pedidos
+              },
+            ),
+
+            _buildMenuItem(
+              icon: Icons.favorite_outline,
+              title: "Favoritos",
+              onTap: () {
+                Navigator.pop(context);
+                // Navegación a favoritos
+              },
+            ),
+
+            _buildMenuItem(
+              icon: Icons.notifications_outlined,
+              title: "Notificaciones",
+              onTap: () {
+                Navigator.pop(context);
+                // Navegación a notificaciones
+              },
+            ),
+
+            _buildMenuItem(
+              icon: Icons.settings_outlined,
+              title: "Configuración",
+              onTap: () {
+                Navigator.pop(context);
+                // Navegación a configuración
+              },
+            ),
+
+            const SizedBox(height: 20),
+
+            // Opción para modo oscuro
+            Padding(
+              padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
+              child: ClipRRect(
+                borderRadius: BorderRadius.circular(16),
+                child: Container(
+                  height: 80,
+                  padding: const EdgeInsets.symmetric(horizontal: 16),
+                  width: double.infinity,
+                  color: Colors.white,
+                  child: Row(
+                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
+                    children: [
+                      const Row(
+                        children: [
+                          Icon(Icons.nights_stay_rounded, size: 28),
+                          Padding(
+                            padding: EdgeInsets.only(left: 8),
+                            child: Text(
+                              "Modo oscuro",
+                              style: TextStyle(
+                                fontSize: 20,
+                                fontWeight: FontWeight.bold,
+                              ),
+                            ),
+                          ),
+                        ],
+                      ),
+                      Switch(
+                        activeColor: Theme.of(context).primaryColor,
+                        value: false,
+                        onChanged: (value) {
+                          // Cambiar tema claro/oscuro
+                        },
+                      ),
+                    ],
+                  ),
                 ),
-                ListTile(
-                  leading: const Icon(Icons.logout),
-                  title: const Text('Cerrar sesión'),
-                  onTap: () {
-                    _showExitConfirmationDialog(context);
-                  },
+              ),
+            ),
+
+            // Botón de cerrar sesión
+            Padding(
+              padding: const EdgeInsets.all(16),
+              child: ClipRRect(
+                borderRadius: BorderRadius.circular(16),
+                child: Container(
+                  decoration: BoxDecoration(
+                    color: Colors.white,
+                    borderRadius: BorderRadius.circular(16),
+                    border: Border.all(color: Colors.red, width: 3),
+                  ),
+                  height: 60,
+                  padding: const EdgeInsets.symmetric(horizontal: 16),
+                  width: double.infinity,
+                  child: InkWell(
+                    onTap: () {
+                      // Acción para cerrar sesión
+                    },
+                    child: const Center(
+                      child: Row(
+                        mainAxisAlignment: MainAxisAlignment.center,
+                        crossAxisAlignment: CrossAxisAlignment.center,
+                        children: [
+                          Icon(
+                            Icons.logout_outlined,
+                            size: 24,
+                            color: Colors.red,
+                          ),
+                          SizedBox(width: 8),
+                          Text(
+                            "Cerrar Sesión",
+                            style: TextStyle(
+                              fontWeight: FontWeight.bold,
+                              fontSize: 18,
+                              color: Colors.red,
+                            ),
+                          ),
+                        ],
+                      ),
+                    ),
+                  ),
                 ),
-              ],
+              ),
             ),
-          ),
-          Padding(
-            padding: const EdgeInsets.only(bottom: 10),
-            child: Align(
-              alignment: Alignment.bottomCenter,
-              child: Text(
-                '$prefijoVersion.1.25.02.11',
-                style: const TextStyle(fontWeight: FontWeight.w300),
+          ],
+        ),
+      ),
+    );
+  }
+
+  Widget _buildMenuItem({
+    required IconData icon,
+    required String title,
+    required VoidCallback onTap,
+  }) {
+    return Padding(
+      padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
+      child: ClipRRect(
+        borderRadius: BorderRadius.circular(16),
+        child: Container(
+          height: 60,
+          color: Colors.white,
+          child: InkWell(
+            onTap: onTap,
+            child: Padding(
+              padding: const EdgeInsets.symmetric(horizontal: 16),
+              child: Row(
+                children: [
+                  Icon(icon, size: 24),
+                  const SizedBox(width: 12),
+                  Text(
+                    title,
+                    style: const TextStyle(
+                      fontSize: 18,
+                      fontWeight: FontWeight.bold,
+                    ),
+                  ),
+                  const Spacer(),
+                  const Icon(Icons.arrow_forward_ios_rounded, size: 16),
+                ],
               ),
             ),
           ),
-        ],
+        ),
       ),
     );
   }