|
|
@ -13,8 +13,6 @@ class AppBottomNavigation extends StatelessWidget { |
|
|
this.isDesktop = false, |
|
|
this.isDesktop = false, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
BuildContext? get context => null; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
@override |
|
|
Widget build(BuildContext context) { |
|
|
Widget build(BuildContext context) { |
|
|
if (isDesktop) return const SizedBox.shrink(); |
|
|
if (isDesktop) return const SizedBox.shrink(); |
|
|
@ -24,7 +22,7 @@ class AppBottomNavigation extends StatelessWidget { |
|
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12), |
|
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12), |
|
|
child: Row( |
|
|
child: Row( |
|
|
children: [ |
|
|
children: [ |
|
|
// Tables Tab |
|
|
// Tables Tab - Index 0 |
|
|
GestureDetector( |
|
|
GestureDetector( |
|
|
onTap: () => onItemTapped(0), |
|
|
onTap: () => onItemTapped(0), |
|
|
child: Container( |
|
|
child: Container( |
|
|
@ -68,7 +66,7 @@ class AppBottomNavigation extends StatelessWidget { |
|
|
|
|
|
|
|
|
const SizedBox(width: 20), |
|
|
const SizedBox(width: 20), |
|
|
|
|
|
|
|
|
// Commandes Tab |
|
|
// Commandes Tab - Index 1 |
|
|
GestureDetector( |
|
|
GestureDetector( |
|
|
onTap: () => onItemTapped(1), |
|
|
onTap: () => onItemTapped(1), |
|
|
child: Container( |
|
|
child: Container( |
|
|
@ -112,15 +110,14 @@ class AppBottomNavigation extends StatelessWidget { |
|
|
|
|
|
|
|
|
const SizedBox(width: 20), |
|
|
const SizedBox(width: 20), |
|
|
|
|
|
|
|
|
// Catégories Tab (Corrigé) |
|
|
// Catégories Tab - Index 2 |
|
|
GestureDetector( |
|
|
GestureDetector( |
|
|
onTap: () => onItemTapped(2), // Index 2 pour catégories |
|
|
onTap: () => onItemTapped(2), |
|
|
child: Container( |
|
|
child: Container( |
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), |
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), |
|
|
decoration: BoxDecoration( |
|
|
decoration: BoxDecoration( |
|
|
color: |
|
|
color: |
|
|
selectedIndex == |
|
|
selectedIndex == 2 |
|
|
2 // Index 2 pour catégories |
|
|
|
|
|
? Colors.green.shade700 |
|
|
? Colors.green.shade700 |
|
|
: Colors.transparent, |
|
|
: Colors.transparent, |
|
|
borderRadius: BorderRadius.circular(20), |
|
|
borderRadius: BorderRadius.circular(20), |
|
|
@ -129,8 +126,7 @@ class AppBottomNavigation extends StatelessWidget { |
|
|
mainAxisSize: MainAxisSize.min, |
|
|
mainAxisSize: MainAxisSize.min, |
|
|
children: [ |
|
|
children: [ |
|
|
Icon( |
|
|
Icon( |
|
|
Icons |
|
|
Icons.category_outlined, |
|
|
.category_outlined, // Icône plus appropriée pour catégories |
|
|
|
|
|
color: |
|
|
color: |
|
|
selectedIndex == 2 |
|
|
selectedIndex == 2 |
|
|
? Colors.white |
|
|
? Colors.white |
|
|
@ -156,6 +152,49 @@ class AppBottomNavigation extends StatelessWidget { |
|
|
), |
|
|
), |
|
|
), |
|
|
), |
|
|
|
|
|
|
|
|
|
|
|
const SizedBox(width: 20), |
|
|
|
|
|
|
|
|
|
|
|
GestureDetector( |
|
|
|
|
|
onTap: () => onItemTapped(3), |
|
|
|
|
|
child: Container( |
|
|
|
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), |
|
|
|
|
|
decoration: BoxDecoration( |
|
|
|
|
|
color: |
|
|
|
|
|
selectedIndex == 3 |
|
|
|
|
|
? Colors.green.shade700 |
|
|
|
|
|
: Colors.transparent, |
|
|
|
|
|
borderRadius: BorderRadius.circular(20), |
|
|
|
|
|
), |
|
|
|
|
|
child: Row( |
|
|
|
|
|
mainAxisSize: MainAxisSize.min, |
|
|
|
|
|
children: [ |
|
|
|
|
|
Icon( |
|
|
|
|
|
Icons.restaurant_menu, |
|
|
|
|
|
color: |
|
|
|
|
|
selectedIndex == 3 |
|
|
|
|
|
? Colors.white |
|
|
|
|
|
: Colors.grey.shade600, |
|
|
|
|
|
size: 16, |
|
|
|
|
|
), |
|
|
|
|
|
const SizedBox(width: 6), |
|
|
|
|
|
Text( |
|
|
|
|
|
'Menu', |
|
|
|
|
|
style: TextStyle( |
|
|
|
|
|
color: |
|
|
|
|
|
selectedIndex == 3 |
|
|
|
|
|
? Colors.white |
|
|
|
|
|
: Colors.grey.shade600, |
|
|
|
|
|
fontWeight: |
|
|
|
|
|
selectedIndex == 3 |
|
|
|
|
|
? FontWeight.w500 |
|
|
|
|
|
: FontWeight.normal, |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
], |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
), |
|
|
|
|
|
|
|
|
const Spacer(), |
|
|
const Spacer(), |
|
|
|
|
|
|
|
|
// User Profile Section |
|
|
// User Profile Section |
|
|
@ -165,7 +204,7 @@ class AppBottomNavigation extends StatelessWidget { |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Widget _buildUserProfile(context) { |
|
|
Widget _buildUserProfile(BuildContext context) { |
|
|
return Row( |
|
|
return Row( |
|
|
children: [ |
|
|
children: [ |
|
|
const SizedBox(width: 6), |
|
|
const SizedBox(width: 6), |
|
|
@ -173,7 +212,7 @@ class AppBottomNavigation extends StatelessWidget { |
|
|
icon: const Icon(Icons.logout), |
|
|
icon: const Icon(Icons.logout), |
|
|
onPressed: () { |
|
|
onPressed: () { |
|
|
Navigator.pushReplacement( |
|
|
Navigator.pushReplacement( |
|
|
context!, |
|
|
context, |
|
|
MaterialPageRoute(builder: (context) => const LoginScreen()), |
|
|
MaterialPageRoute(builder: (context) => const LoginScreen()), |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
|