2024-05-30 12:38:14 +05:30
|
|
|
import 'package:flutter/material.dart';
|
2024-06-05 15:05:11 +05:30
|
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
2024-05-30 12:38:14 +05:30
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
2024-06-05 15:05:11 +05:30
|
|
|
import 'package:google_fonts/google_fonts.dart';
|
|
|
|
|
import 'package:tanami_app/core/styles/app_color.dart';
|
2024-05-30 12:38:14 +05:30
|
|
|
|
2024-07-10 20:35:18 +05:30
|
|
|
import '../../core/utils/language/localizations_delegate.dart';
|
2024-06-05 15:05:11 +05:30
|
|
|
import 'bloc/bottom_nav_bar/bottom_navigation_bloc.dart';
|
|
|
|
|
import 'bloc/bottom_nav_bar/bottom_navigation_event.dart';
|
|
|
|
|
|
2024-06-12 13:28:22 +05:30
|
|
|
Widget bottomnavigationbar(
|
|
|
|
|
BuildContext context, selectedIndex, PageController pageController) {
|
2024-07-10 20:35:18 +05:30
|
|
|
var localizations = AppLocalizations.of(context);
|
2024-05-30 13:56:20 +05:30
|
|
|
return BottomNavigationBar(
|
2024-06-18 18:39:07 +05:30
|
|
|
backgroundColor: AppColor.plainWhite,
|
2024-05-30 13:56:20 +05:30
|
|
|
type: BottomNavigationBarType.fixed,
|
|
|
|
|
showUnselectedLabels: true,
|
2024-06-05 15:05:11 +05:30
|
|
|
selectedItemColor: AppColor.selectedItemColor,
|
|
|
|
|
unselectedItemColor: AppColor.unselectedItemColor,
|
|
|
|
|
unselectedLabelStyle: GoogleFonts.dmSans(
|
2024-05-30 13:56:20 +05:30
|
|
|
fontSize: 10.sp,
|
2024-06-05 15:05:11 +05:30
|
|
|
color: AppColor.unselectedItemColor,
|
2024-05-30 13:56:20 +05:30
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
),
|
2024-06-05 15:05:11 +05:30
|
|
|
selectedLabelStyle: GoogleFonts.dmSans(
|
2024-05-30 13:56:20 +05:30
|
|
|
fontSize: 10.sp,
|
2024-06-05 15:05:11 +05:30
|
|
|
color: AppColor.selectedItemColor,
|
2024-05-30 13:56:20 +05:30
|
|
|
fontWeight: FontWeight.w400,
|
|
|
|
|
),
|
|
|
|
|
currentIndex: selectedIndex,
|
|
|
|
|
onTap: (index) {
|
2024-06-12 13:28:22 +05:30
|
|
|
pageController.jumpToPage(index);
|
|
|
|
|
|
2024-06-05 15:05:11 +05:30
|
|
|
context.read<BottomNavigationBloc>().add(TabChanged(index));
|
2024-05-30 13:56:20 +05:30
|
|
|
},
|
|
|
|
|
items: [
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/inactive/wallet.png',
|
|
|
|
|
height: 26.h,
|
|
|
|
|
width: 26.w,
|
2024-05-30 12:38:14 +05:30
|
|
|
),
|
2024-05-30 13:56:20 +05:30
|
|
|
activeIcon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/active/wallet.png',
|
|
|
|
|
height: 30.h,
|
|
|
|
|
width: 30.w,
|
2024-05-30 12:38:14 +05:30
|
|
|
),
|
2024-07-10 20:35:18 +05:30
|
|
|
label: localizations.translate('Wallet'),
|
2024-05-30 13:56:20 +05:30
|
|
|
),
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/inactive/portfolio.png',
|
|
|
|
|
height: 26.h,
|
|
|
|
|
width: 26.w,
|
2024-05-30 12:38:14 +05:30
|
|
|
),
|
2024-05-30 13:56:20 +05:30
|
|
|
activeIcon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/active/portfolio.png',
|
|
|
|
|
height: 30.h,
|
|
|
|
|
width: 30.w,
|
|
|
|
|
),
|
2024-07-10 20:35:18 +05:30
|
|
|
label: localizations.translate('Portfolio'),
|
2024-05-30 13:56:20 +05:30
|
|
|
),
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/inactive/invest.png',
|
|
|
|
|
height: 24.h,
|
|
|
|
|
width: 24.w,
|
|
|
|
|
),
|
|
|
|
|
activeIcon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/active/invest.png',
|
|
|
|
|
height: 28.h,
|
|
|
|
|
width: 28.w,
|
2024-05-30 12:38:14 +05:30
|
|
|
),
|
2024-07-10 20:35:18 +05:30
|
|
|
label: localizations.translate('Invest'),
|
2024-05-30 13:56:20 +05:30
|
|
|
),
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/inactive/academy.png',
|
|
|
|
|
height: 26.h,
|
|
|
|
|
width: 26.w,
|
2024-05-30 12:38:14 +05:30
|
|
|
),
|
2024-05-30 13:56:20 +05:30
|
|
|
activeIcon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/active/academy.png',
|
|
|
|
|
height: 30.h,
|
|
|
|
|
width: 30.w,
|
|
|
|
|
),
|
2024-07-10 20:35:18 +05:30
|
|
|
label: localizations.translate('Academy'),
|
2024-05-30 13:56:20 +05:30
|
|
|
),
|
|
|
|
|
BottomNavigationBarItem(
|
|
|
|
|
icon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/inactive/settings.png',
|
|
|
|
|
height: 26.h,
|
|
|
|
|
width: 26.w,
|
|
|
|
|
),
|
|
|
|
|
activeIcon: Image.asset(
|
|
|
|
|
'assets/images/bottom_bar/active/settings.png',
|
|
|
|
|
height: 30.h,
|
|
|
|
|
width: 30.w,
|
|
|
|
|
),
|
2024-07-10 20:35:18 +05:30
|
|
|
label: localizations.translate('Settings'),
|
2024-05-30 13:56:20 +05:30
|
|
|
),
|
|
|
|
|
],
|
2024-05-30 12:38:14 +05:30
|
|
|
);
|
|
|
|
|
}
|