|
@@ -8,8 +8,10 @@ import 'package:yoshi_papas_app/views/sucursal/sucursal_screen.dart';
|
|
import 'package:yoshi_papas_app/views/variable/variable_screen.dart';
|
|
import 'package:yoshi_papas_app/views/variable/variable_screen.dart';
|
|
import 'package:yoshi_papas_app/views/venta/venta_screen.dart';
|
|
import 'package:yoshi_papas_app/views/venta/venta_screen.dart';
|
|
import 'package:provider/provider.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
+import '../models/models.dart';
|
|
import '../themes/themes.dart';
|
|
import '../themes/themes.dart';
|
|
import '../viewmodels/login_view_model.dart';
|
|
import '../viewmodels/login_view_model.dart';
|
|
|
|
+import '../viewmodels/viewmodels.dart';
|
|
import '../views/descuento/descuento_screen.dart';
|
|
import '../views/descuento/descuento_screen.dart';
|
|
import 'widgets_components.dart';
|
|
import 'widgets_components.dart';
|
|
|
|
|
|
@@ -47,6 +49,8 @@ class AppDrawer extends StatelessWidget {
|
|
|
|
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
|
+ final permisoViewModel = Provider.of<PermisoViewModel>(context);
|
|
|
|
+ final userPermisos = permisoViewModel.userPermisos;
|
|
return Drawer(
|
|
return Drawer(
|
|
surfaceTintColor: Colors.white,
|
|
surfaceTintColor: Colors.white,
|
|
backgroundColor: Colors.white,
|
|
backgroundColor: Colors.white,
|
|
@@ -106,19 +110,20 @@ class AppDrawer extends StatelessWidget {
|
|
),
|
|
),
|
|
},
|
|
},
|
|
),
|
|
),
|
|
- ListTile(
|
|
|
|
- leading:
|
|
|
|
- circulo(const Icon(Icons.format_list_bulleted_rounded)),
|
|
|
|
- title: const Text('Categoría Producto'),
|
|
|
|
- onTap: () => {
|
|
|
|
- Navigator.pop(context),
|
|
|
|
- Navigator.of(context).push(
|
|
|
|
- MaterialPageRoute(
|
|
|
|
- builder: (context) => CategoriaProductoScreen(),
|
|
|
|
|
|
+ if (userPermisos.contains(Usuario.VER_CATEGORIAS))
|
|
|
|
+ ListTile(
|
|
|
|
+ leading:
|
|
|
|
+ circulo(const Icon(Icons.format_list_bulleted_rounded)),
|
|
|
|
+ title: const Text('Categoría Producto'),
|
|
|
|
+ onTap: () => {
|
|
|
|
+ Navigator.pop(context),
|
|
|
|
+ Navigator.of(context).push(
|
|
|
|
+ MaterialPageRoute(
|
|
|
|
+ builder: (context) => CategoriaProductoScreen(),
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
- ),
|
|
|
|
- },
|
|
|
|
- ),
|
|
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
ListTile(
|
|
ListTile(
|
|
leading: circulo(const Icon(Icons.receipt_long_outlined)),
|
|
leading: circulo(const Icon(Icons.receipt_long_outlined)),
|
|
title: const Text('Pedidos Por Día'),
|
|
title: const Text('Pedidos Por Día'),
|
|
@@ -159,18 +164,19 @@ class AppDrawer extends StatelessWidget {
|
|
),
|
|
),
|
|
},
|
|
},
|
|
),
|
|
),
|
|
- ListTile(
|
|
|
|
- leading: circulo(const Icon(Icons.storefront_outlined)),
|
|
|
|
- title: const Text('Sucursales'),
|
|
|
|
- onTap: () => {
|
|
|
|
- Navigator.pop(context),
|
|
|
|
- Navigator.of(context).push(
|
|
|
|
- MaterialPageRoute(
|
|
|
|
- builder: (context) => SucursalesPage(),
|
|
|
|
|
|
+ if (userPermisos.contains(Usuario.VER_SUCURSALES))
|
|
|
|
+ ListTile(
|
|
|
|
+ leading: circulo(const Icon(Icons.storefront_outlined)),
|
|
|
|
+ title: const Text('Sucursales'),
|
|
|
|
+ onTap: () => {
|
|
|
|
+ Navigator.pop(context),
|
|
|
|
+ Navigator.of(context).push(
|
|
|
|
+ MaterialPageRoute(
|
|
|
|
+ builder: (context) => SucursalesPage(),
|
|
|
|
+ ),
|
|
),
|
|
),
|
|
- ),
|
|
|
|
- },
|
|
|
|
- ),
|
|
|
|
|
|
+ },
|
|
|
|
+ ),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
ListTile(
|
|
ListTile(
|