|
@@ -30,6 +30,7 @@ class Formulario extends State<HomeScreen> {
|
|
@override
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
final mesaViewModel = Provider.of<MesaViewModel>(context);
|
|
final mesaViewModel = Provider.of<MesaViewModel>(context);
|
|
|
|
+ final loginViewModel = Provider.of<LoginViewModel>(context);
|
|
var _selectedIndex;
|
|
var _selectedIndex;
|
|
return Scaffold(
|
|
return Scaffold(
|
|
backgroundColor: Colors.grey.shade200,
|
|
backgroundColor: Colors.grey.shade200,
|
|
@@ -45,6 +46,10 @@ class Formulario extends State<HomeScreen> {
|
|
setState(() {
|
|
setState(() {
|
|
_selectedIndex = index;
|
|
_selectedIndex = index;
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ if (index == 3) {
|
|
|
|
+ loginViewModel.showExitConfirmationDialog(context);
|
|
|
|
+ }
|
|
},
|
|
},
|
|
labelType: NavigationRailLabelType.all,
|
|
labelType: NavigationRailLabelType.all,
|
|
destinations: const [
|
|
destinations: const [
|
|
@@ -66,6 +71,11 @@ class Formulario extends State<HomeScreen> {
|
|
selectedIcon: Icon(Icons.settings_rounded, color: Colors.white),
|
|
selectedIcon: Icon(Icons.settings_rounded, color: Colors.white),
|
|
label: Text('Ajustes'),
|
|
label: Text('Ajustes'),
|
|
),
|
|
),
|
|
|
|
+ NavigationRailDestination(
|
|
|
|
+ icon: Icon(Icons.logout),
|
|
|
|
+ selectedIcon: Icon(Icons.logout, color: Colors.white),
|
|
|
|
+ label: Text('Cerrar Sesión'),
|
|
|
|
+ ),
|
|
],
|
|
],
|
|
),
|
|
),
|
|
Expanded(
|
|
Expanded(
|