fix phone dashboard
This commit is contained in:
@@ -24,7 +24,10 @@ class DashboardShell extends ConsumerWidget {
|
||||
final employee = ref.watch(authProvider).employee;
|
||||
|
||||
int currentIndex = 0;
|
||||
if (location.startsWith('/dashboard/vehicles')) currentIndex = 1;
|
||||
if (location.startsWith('/dashboard/fleet') ||
|
||||
location.startsWith('/dashboard/vehicles')) {
|
||||
currentIndex = 1;
|
||||
}
|
||||
if (location.startsWith('/dashboard/reservations')) currentIndex = 2;
|
||||
if (location.startsWith('/dashboard/customers')) currentIndex = 3;
|
||||
|
||||
@@ -37,15 +40,14 @@ class DashboardShell extends ConsumerWidget {
|
||||
bottomNavigationBar: NavigationBar(
|
||||
selectedIndex: currentIndex,
|
||||
onDestinationSelected: (i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
context.go('/dashboard');
|
||||
case 1:
|
||||
context.go('/dashboard/vehicles');
|
||||
case 2:
|
||||
context.go('/dashboard/reservations');
|
||||
case 3:
|
||||
context.go('/dashboard/customers');
|
||||
if (i == 0) {
|
||||
context.go('/dashboard');
|
||||
} else if (i == 1) {
|
||||
context.go('/dashboard/fleet');
|
||||
} else if (i == 2) {
|
||||
context.go('/dashboard/reservations');
|
||||
} else if (i == 3) {
|
||||
context.go('/dashboard/customers');
|
||||
}
|
||||
},
|
||||
destinations: const [
|
||||
@@ -57,7 +59,7 @@ class DashboardShell extends ConsumerWidget {
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.directions_car_outlined),
|
||||
selectedIcon: Icon(Icons.directions_car),
|
||||
label: 'Vehicles',
|
||||
label: 'Fleet',
|
||||
),
|
||||
NavigationDestination(
|
||||
icon: Icon(Icons.event_note_outlined),
|
||||
@@ -141,10 +143,10 @@ class _Drawer extends ConsumerWidget {
|
||||
),
|
||||
_NavItem(
|
||||
icon: Icons.directions_car_outlined,
|
||||
label: 'Vehicles',
|
||||
label: 'Fleet',
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
context.go('/dashboard/vehicles');
|
||||
context.go('/dashboard/fleet');
|
||||
},
|
||||
),
|
||||
_NavItem(
|
||||
@@ -166,7 +168,7 @@ class _Drawer extends ConsumerWidget {
|
||||
const Divider(),
|
||||
_NavItem(
|
||||
icon: Icons.public_outlined,
|
||||
label: 'Online Requests',
|
||||
label: 'Online Reservations',
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
context.push('/dashboard/online-reservations');
|
||||
|
||||
Reference in New Issue
Block a user