EXVYONE-flood-app-monitor/lib/widgets/bottom_navbar.dart

55 lines
1.6 KiB
Dart

import 'package:flutter/material.dart';
import '../utils/constants.dart';
class BottomNavbar extends StatelessWidget {
final int currentIndex;
final Function(int) onTap;
const BottomNavbar({super.key, required this.currentIndex, required this.onTap});
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(20),
topRight: Radius.circular(20),
),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: const Offset(0, -2),
),
],
),
child: BottomNavigationBar(
currentIndex: currentIndex,
onTap: onTap,
backgroundColor: Colors.transparent,
elevation: 0,
selectedItemColor: AppColors.primary,
unselectedItemColor: Colors.grey,
showUnselectedLabels: true,
type: BottomNavigationBarType.fixed,
selectedLabelStyle: const TextStyle(fontWeight: FontWeight.bold),
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.location_on_outlined, size: 28),
label: 'Lokasi',
),
BottomNavigationBarItem(
icon: Icon(Icons.monitor_heart_outlined, size: 30),
label: 'Monitoring',
),
BottomNavigationBarItem(
icon: Icon(Icons.settings_outlined, size: 28),
label: 'Pengaturan',
),
],
),
);
}
}