2025-08-12 17:36:41 +07:00
|
|
|
import 'package:auto_route/auto_route.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:line_icons/line_icon.dart';
|
|
|
|
|
import 'package:line_icons/line_icons.dart';
|
|
|
|
|
|
2025-08-13 01:17:00 +07:00
|
|
|
import '../../../../common/extension/extension.dart';
|
|
|
|
|
|
2025-08-12 17:36:41 +07:00
|
|
|
class MainBottomNavbar extends StatefulWidget {
|
|
|
|
|
final TabsRouter tabsRouter;
|
|
|
|
|
|
|
|
|
|
const MainBottomNavbar({super.key, required this.tabsRouter});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
State<MainBottomNavbar> createState() => _MainBottomNavbarState();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class _MainBottomNavbarState extends State<MainBottomNavbar> {
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return BottomNavigationBar(
|
|
|
|
|
currentIndex: widget.tabsRouter.activeIndex,
|
|
|
|
|
onTap: (index) {
|
|
|
|
|
setState(() {
|
|
|
|
|
widget.tabsRouter.setActiveIndex(index);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
type: BottomNavigationBarType.fixed,
|
|
|
|
|
items: [
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: LineIcon(LineIcons.home),
|
2025-08-13 01:17:00 +07:00
|
|
|
label: context.lang.home,
|
|
|
|
|
tooltip: context.lang.home,
|
2025-08-12 17:36:41 +07:00
|
|
|
),
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: LineIcon(LineIcons.moneyBill),
|
2025-08-13 01:17:00 +07:00
|
|
|
label: context.lang.transaction,
|
|
|
|
|
tooltip: context.lang.transaction,
|
2025-08-12 17:36:41 +07:00
|
|
|
),
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: LineIcon(LineIcons.barChart),
|
2025-08-13 01:17:00 +07:00
|
|
|
label: context.lang.report,
|
|
|
|
|
tooltip: context.lang.report,
|
2025-08-12 17:36:41 +07:00
|
|
|
),
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: LineIcon(LineIcons.user),
|
2025-08-13 01:17:00 +07:00
|
|
|
label: context.lang.profile,
|
|
|
|
|
tooltip: context.lang.profile,
|
2025-08-12 17:36:41 +07:00
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|