80 lines
2.5 KiB
Dart
80 lines
2.5 KiB
Dart
import 'package:cims_apps/application/theme/color_palette.dart';
|
|
import 'package:cims_apps/features/dashboard/dashboard_account/view/homepage/homepage_view.dart';
|
|
import 'package:cims_apps/features/dashboard/dashboard_account/view/plan/view/plan_view.dart';
|
|
import 'package:cims_apps/features/dashboard/dashboard_account/view/plan/view_model/plan_view_model.dart';
|
|
import 'package:cims_apps/features/dashboard/dashboard_account/view/portfolio/portfolio_view.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
class BottomNavigationView extends StatefulWidget {
|
|
const BottomNavigationView({Key? key}) : super(key: key);
|
|
|
|
@override
|
|
State<BottomNavigationView> createState() => _BottomNavigationViewState();
|
|
}
|
|
|
|
class _BottomNavigationViewState extends State<BottomNavigationView> {
|
|
int _selectedIndex = 0;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
///TODO: masukan pagenya dilistWidget ini
|
|
List<Widget> listWidget = [
|
|
HomeView(),
|
|
PlanView(),
|
|
Container(),
|
|
PortofolioView(),
|
|
Container(),
|
|
];
|
|
|
|
List<BottomNavigationBarItem> listNavigation = const [
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.home_outlined),
|
|
label: 'Home',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.file_open),
|
|
label: 'Plan',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.compare_arrows),
|
|
label: 'Transaction',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.pie_chart_rounded),
|
|
label: 'Portfolio',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.person),
|
|
label: 'Profile',
|
|
),
|
|
];
|
|
|
|
return ChangeNotifierProvider(
|
|
create: (context) => PlanViewModel(),
|
|
child: Scaffold(
|
|
body: listWidget[_selectedIndex],
|
|
bottomNavigationBar: Padding(
|
|
padding: const EdgeInsets.symmetric(vertical: 12),
|
|
child: BottomNavigationBar(
|
|
elevation: 0,
|
|
onTap: (value) {
|
|
setState(() {
|
|
_selectedIndex = value;
|
|
});
|
|
},
|
|
currentIndex: _selectedIndex,
|
|
items: listNavigation,
|
|
type: BottomNavigationBarType.fixed,
|
|
showUnselectedLabels: true,
|
|
selectedItemColor: ColorPalette.primary,
|
|
unselectedItemColor: Colors.black,
|
|
selectedLabelStyle: const TextStyle(color: ColorPalette.primary),
|
|
unselectedLabelStyle: const TextStyle(color: Colors.black),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|