44 lines
1.1 KiB
Dart
44 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
/// Bottom navigation bar for the app
|
|
class AppBottomNav extends StatelessWidget {
|
|
final int currentIndex;
|
|
final Function(int) onTap;
|
|
|
|
const AppBottomNav({
|
|
super.key,
|
|
required this.currentIndex,
|
|
required this.onTap,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return NavigationBar(
|
|
selectedIndex: currentIndex,
|
|
onDestinationSelected: onTap,
|
|
destinations: const [
|
|
NavigationDestination(
|
|
icon: Icon(Icons.home_outlined),
|
|
selectedIcon: Icon(Icons.home),
|
|
label: 'Home',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.inventory_2_outlined),
|
|
selectedIcon: Icon(Icons.inventory_2),
|
|
label: 'Products',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.category_outlined),
|
|
selectedIcon: Icon(Icons.category),
|
|
label: 'Categories',
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.settings_outlined),
|
|
selectedIcon: Icon(Icons.settings),
|
|
label: 'Settings',
|
|
),
|
|
],
|
|
);
|
|
}
|
|
}
|