MIF_E31230910_MP-HRIS-MOBILE/lib/widgets/organisms/bottom_navbar.dart

67 lines
2.0 KiB
Dart

import 'package:flutter/material.dart';
import '../../core/theme.dart';
class BottomNavbar extends StatelessWidget {
final int currentIndex;
final Function(int) onTap;
const BottomNavbar({
Key? key,
required this.currentIndex,
required this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: AppTheme.primaryDark,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(AppTheme.radiusLg),
topRight: Radius.circular(AppTheme.radiusLg),
),
boxShadow: AppTheme.shadowLg,
),
child: ClipRRect(
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(AppTheme.radiusLg),
topRight: Radius.circular(AppTheme.radiusLg),
),
child: BottomNavigationBar(
currentIndex: currentIndex,
onTap: onTap,
backgroundColor: AppTheme.primaryDark,
selectedItemColor: Colors.white,
unselectedItemColor: Colors.white.withOpacity(0.5),
showUnselectedLabels: false,
showSelectedLabels: false,
type: BottomNavigationBarType.fixed,
elevation: 0,
items: const [
BottomNavigationBarItem(
icon: Icon(Icons.home_outlined),
activeIcon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.calendar_today_outlined),
activeIcon: Icon(Icons.calendar_today),
label: 'Calendar',
),
BottomNavigationBarItem(
icon: Icon(Icons.receipt_long_outlined),
activeIcon: Icon(Icons.receipt_long),
label: 'Document',
),
BottomNavigationBarItem(
icon: Icon(Icons.person_outline),
activeIcon: Icon(Icons.person),
label: 'Profile',
),
],
),
),
);
}
}