diff --git a/assets/images/bottom_bar/inactive/InactiveHome.png b/assets/images/bottom_bar/inactive/InactiveHome.png new file mode 100644 index 0000000..e132323 Binary files /dev/null and b/assets/images/bottom_bar/inactive/InactiveHome.png differ diff --git a/assets/images/bottom_bar/inactive/Investinactive.png b/assets/images/bottom_bar/inactive/Investinactive.png new file mode 100644 index 0000000..a22f6ef Binary files /dev/null and b/assets/images/bottom_bar/inactive/Investinactive.png differ diff --git a/assets/images/bottom_bar/inactive/SettingInactive.png b/assets/images/bottom_bar/inactive/SettingInactive.png new file mode 100644 index 0000000..4599119 Binary files /dev/null and b/assets/images/bottom_bar/inactive/SettingInactive.png differ diff --git a/assets/images/bottom_bar/inactive/academyinactive.png b/assets/images/bottom_bar/inactive/academyinactive.png new file mode 100644 index 0000000..59f998b Binary files /dev/null and b/assets/images/bottom_bar/inactive/academyinactive.png differ diff --git a/assets/images/bottom_bar/inactive/portfolioinactive.png b/assets/images/bottom_bar/inactive/portfolioinactive.png new file mode 100644 index 0000000..385c3c7 Binary files /dev/null and b/assets/images/bottom_bar/inactive/portfolioinactive.png differ diff --git a/lib/core/routes/route_name.dart b/lib/core/routes/route_name.dart index b7f6820..e1f07a5 100644 --- a/lib/core/routes/route_name.dart +++ b/lib/core/routes/route_name.dart @@ -17,4 +17,7 @@ class RouteName { //choose country static const String chooseCountryScreen = 'chooseCountryScreen'; + + // + static const String mainScreen = 'mainScreen'; } diff --git a/lib/core/routes/routes.dart b/lib/core/routes/routes.dart index f3e3ff6..f3dee37 100644 --- a/lib/core/routes/routes.dart +++ b/lib/core/routes/routes.dart @@ -2,6 +2,7 @@ import 'package:go_router/go_router.dart'; import 'package:tanami_app/core/routes/route_name.dart'; +import 'package:tanami_app/features/Home/presentation/pages/mainScreen.dart'; import 'package:tanami_app/features/countrySelection/presentation/pages/choose_country_screen.dart'; import 'package:tanami_app/features/welcome/presentation/pages/weclome_screen.dart'; @@ -51,6 +52,13 @@ final goRouter = GoRouter( return const ChooseCountryScreen(); }, ), + GoRoute( + name: RouteName.mainScreen, + path: RouteName.mainScreen, + builder: (context, state) { + return const MainScreen(); + }, + ), ]), // GoRoute( diff --git a/lib/features/Home/presentation/pages/HomeScreen.dart b/lib/features/Home/presentation/pages/HomeScreen.dart new file mode 100644 index 0000000..7a26c8c --- /dev/null +++ b/lib/features/Home/presentation/pages/HomeScreen.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; +import 'package:tanami_app/features/Home/presentation/pages/mainScreen.dart'; +import 'package:tanami_app/shared/components/common_bottom_navigation.dart'; + +class HomeScreen extends StatefulWidget { + const HomeScreen({super.key}); + + @override + State createState() => _HomeScreenState(); +} + +class _HomeScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + body: Column( + children: [Text("data")], + ), + bottomNavigationBar: bottomnavigationbar(selectedIndex), + ); + } +} diff --git a/lib/features/Home/presentation/pages/MainScreen.dart b/lib/features/Home/presentation/pages/MainScreen.dart new file mode 100644 index 0000000..d147484 --- /dev/null +++ b/lib/features/Home/presentation/pages/MainScreen.dart @@ -0,0 +1,26 @@ +import 'package:flutter/material.dart'; +import 'package:tanami_app/features/Home/presentation/pages/HomeScreen.dart'; +import 'package:tanami_app/shared/components/common_bottom_navigation.dart'; + +var currentTab = [ + const HomeScreen(), + const SizedBox(), + const SizedBox(), + const SizedBox(), +]; + +var selectedIndex = 0; + +void updateTab(int index) { + selectedIndex = index; +} + +class MainScreen extends StatelessWidget { + const MainScreen({super.key}); + @override + Widget build(BuildContext context) { + return Scaffold( + body: currentTab[selectedIndex], + ); + } +} diff --git a/lib/features/login/presentation/widgets/bottom_section.dart b/lib/features/login/presentation/widgets/bottom_section.dart index 9cd4dc0..a821bb3 100644 --- a/lib/features/login/presentation/widgets/bottom_section.dart +++ b/lib/features/login/presentation/widgets/bottom_section.dart @@ -40,6 +40,7 @@ class BottomSection extends StatelessWidget { Loader.loader(context); } else if (state is LoginSuccess) { goRouter.pop(); + goRouter.goNamed('mainScreen'); successToastMessage(context, "login successful !"); } else if (state is LoginFailure) { goRouter.pop(); diff --git a/lib/features/splash/presentation/widgets/bottom_version_widget.dart b/lib/features/splash/presentation/widgets/bottom_version_widget.dart index b3d03f8..6c8c9bc 100644 --- a/lib/features/splash/presentation/widgets/bottom_version_widget.dart +++ b/lib/features/splash/presentation/widgets/bottom_version_widget.dart @@ -32,8 +32,6 @@ class BottomVersionWidget extends StatelessWidget { TextWidget().text12W400( '${AppText.splashVersionText}${state.version}'), TextWidget().text12W400(AppText.splashCopyrightText), - //removethis - SizedBox() ], )); // If the state is AppVersionError, display an error message diff --git a/lib/shared/components/common_bottom_navigation.dart b/lib/shared/components/common_bottom_navigation.dart new file mode 100644 index 0000000..aefd672 --- /dev/null +++ b/lib/shared/components/common_bottom_navigation.dart @@ -0,0 +1,251 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:tanami_app/features/Home/presentation/pages/MainScreen.dart'; + +Container bottomnavigationbar(selectedIndex) { + return Container( + width: double.infinity, + height: 83.h, + color: Colors.white, + alignment: Alignment.center, + child: BottomNavigationBar( + // backgroundColor: , + type: BottomNavigationBarType.fixed, + backgroundColor: const Color(0xFFFFFFFF).withOpacity(0), + showUnselectedLabels: true, + selectedItemColor: Colors.white, + unselectedItemColor: const Color(0xFF676767), + unselectedLabelStyle: TextStyle( + fontSize: 10.sp, + color: const Color(0xFF676767), + fontWeight: FontWeight.w400, + fontFamily: 'hiragino'), + selectedLabelStyle: TextStyle( + fontSize: 10.sp, + color: const Color(0xFFFFFFFF), + fontWeight: FontWeight.w400, + fontFamily: 'hiragino'), + currentIndex: selectedIndex, + onTap: (index) { + updateTab(index); + }, + items: [ + BottomNavigationBarItem( + icon: Image.asset( + 'assets/images/bottom_bar/inactive/InactiveHome.png', + height: 26.h, + width: 26.w, + ), + // Icon( + // Icons.home, + // color: Color(0xFF676767), + // ), + activeIcon: Stack( + children: [ + if (selectedIndex == 0) + Container( + height: 40.h, + width: 40.w, + decoration: BoxDecoration( + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.4), + spreadRadius: 15, + blurRadius: 10, + offset: const Offset(0, 10), + ), + ], + ), + ), + Positioned( + top: 0, + bottom: 0, + right: 0, + left: 0, + child: Center( + child: Image.asset( + 'assets/images/png/sidemenu/activehome.png', + height: 30.h, + width: 30.w, + ), + ), + ) + ], + ), + + // activeIcon: SvgPicture.asset('assets/image/svg/active_home.svg'), + label: 'Wallet', + ), + BottomNavigationBarItem( + icon: Image.asset( + 'assets/images/bottom_bar/inactive/portfolioinactive.png', + height: 26.h, + width: 26.w, + ), + activeIcon: Stack( + children: [ + if (selectedIndex == 1) + Container( + height: 40.h, + width: 40.w, + decoration: BoxDecoration( + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.4), + spreadRadius: 15, + blurRadius: 10, + offset: const Offset(0, 10), + ), + ], + ), + ), + Positioned( + left: 0, + right: 0, + top: 0, + bottom: 0, + child: Center( + child: Image.asset( + 'assets/images/png/sidemenu/activetrade.png', + height: 30.h, + width: 30.w, + ), + )) + ], + ), + + // SvgPicture.asset('assets/image/svg/active_shortTrade.svg'), + label: 'Portfolio', + ), + BottomNavigationBarItem( + icon: Image.asset( + 'assets/images/bottom_bar/inactive/Investinactive.png', + height: 24.h, + width: 24.w, + ), + activeIcon: Stack( + children: [ + if (selectedIndex == 2) + Container( + height: 40.h, + width: 40.w, + decoration: BoxDecoration( + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.4), + spreadRadius: 15, + blurRadius: 10, + offset: const Offset(0, 10), + ), + ], + ), + ), + Positioned( + left: 0, + right: 0, + top: 0, + bottom: 0, + child: Center( + child: Image.asset( + 'assets/images/png/pastPerformanceactive.png', + height: 28.h, + width: 28.w, + ), + )) + ], + ), + + // SvgPicture.asset('assets/image/svg/active_shortTrade.svg'), + label: 'Invest', + ), + BottomNavigationBarItem( + icon: Image.asset( + 'assets/images/bottom_bar/inactive/academyinactive.png', + height: 26.h, + width: 26.w, + ), + activeIcon: Stack( + children: [ + if (selectedIndex == 3) + Container( + height: 40.h, + width: 40.w, + decoration: BoxDecoration( + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.4), + spreadRadius: 15, + blurRadius: 10, + offset: const Offset(0, 10), + ), + ], + ), + ), + Positioned( + left: 0, + right: 0, + top: 0, + bottom: 0, + child: Center( + child: Image.asset( + 'assets/images/png/sidemenu/activeprotfolio.png', + height: 30.h, + width: 30.w, + ), + )) + ], + ), + + // SvgPicture.asset('assets/image/svg/active_protfolio.svg'), + label: 'Academy', + ), + BottomNavigationBarItem( + icon: Image.asset( + 'assets/images/bottom_bar/inactive/SettingInactive.png', + height: 26.h, + width: 26.w, + ), + activeIcon: Stack( + children: [ + if (selectedIndex == 3) + Container( + height: 40.h, + width: 40.w, + decoration: BoxDecoration( + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.4), + spreadRadius: 15, + blurRadius: 10, + offset: const Offset(0, 10), + ), + ], + ), + ), + Positioned( + left: 0, + right: 0, + top: 0, + bottom: 0, + child: Center( + child: Image.asset( + 'assets/images/png/sidemenu/activeprotfolio.png', + height: 30.h, + width: 30.w, + ), + )) + ], + ), + + // SvgPicture.asset('assets/image/svg/active_protfolio.svg'), + label: 'Settings', + ), + ], + ), + ); +} diff --git a/pubspec.yaml b/pubspec.yaml index 335c34f..c3a211b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -94,3 +94,5 @@ flutter: - assets/images/country_flag/ - assets/images/country_flag/svg/ - assets/images/country_flag/png/ + - assets/images/bottom_bar/inactive + - assets/images/bottom_bar/active