42 lines
1.2 KiB
Dart
42 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class BottomNavBar extends StatelessWidget {
|
|
final int selectedIndex;
|
|
final Function(int) onItemTapped;
|
|
|
|
const BottomNavBar({
|
|
super.key,
|
|
required this.selectedIndex,
|
|
required this.onItemTapped,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SafeArea(
|
|
child: SizedBox(
|
|
height: 80,
|
|
child: BottomNavigationBar(
|
|
backgroundColor: Colors.grey[900],
|
|
currentIndex: selectedIndex,
|
|
onTap: onItemTapped,
|
|
showSelectedLabels: true,
|
|
showUnselectedLabels: true,
|
|
type: BottomNavigationBarType.fixed,
|
|
selectedFontSize: 12,
|
|
unselectedFontSize: 12,
|
|
selectedItemColor: Colors.white,
|
|
unselectedItemColor: Colors.white70,
|
|
items: const [
|
|
BottomNavigationBarItem(icon: Icon(Icons.book), label: "Book"),
|
|
BottomNavigationBarItem(icon: Icon(Icons.my_location), label: "Shooting"),
|
|
BottomNavigationBarItem(icon: Icon(Icons.camera_alt), label: "Camera"),
|
|
BottomNavigationBarItem(icon: Icon(Icons.calendar_today), label: "Calendar"),
|
|
BottomNavigationBarItem(icon: Icon(Icons.settings), label: "Settings"),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
}
|