42 lines
1.1 KiB
Dart
42 lines
1.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class CustomNavigationBar extends StatelessWidget {
|
|
final int selectedIndex;
|
|
final void Function(int) onItemTapped;
|
|
const CustomNavigationBar({
|
|
super.key,
|
|
required this.selectedIndex,
|
|
required this.onItemTapped,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return NavigationBar(
|
|
selectedIndex: selectedIndex,
|
|
onDestinationSelected: onItemTapped,
|
|
labelBehavior: NavigationDestinationLabelBehavior.alwaysHide,
|
|
destinations: const [
|
|
NavigationDestination(
|
|
icon: Icon(Icons.home),
|
|
label: 'Home'
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.format_quote),
|
|
label: 'Quote'
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.radar),
|
|
label: 'Tracking'
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.account_box),
|
|
label: 'Login'
|
|
),
|
|
NavigationDestination(
|
|
icon: Icon(Icons.person_add),
|
|
label: 'Setup'
|
|
),
|
|
],
|
|
);
|
|
}
|
|
} |