diff --git a/assets/images/bottom_bar/active/academy.png b/assets/images/bottom_bar/active/academy.png new file mode 100644 index 0000000..f54020a Binary files /dev/null and b/assets/images/bottom_bar/active/academy.png differ diff --git a/assets/images/bottom_bar/active/invest.png b/assets/images/bottom_bar/active/invest.png new file mode 100644 index 0000000..82bed02 Binary files /dev/null and b/assets/images/bottom_bar/active/invest.png differ diff --git a/assets/images/bottom_bar/active/portfolio.png b/assets/images/bottom_bar/active/portfolio.png new file mode 100644 index 0000000..00b3c37 Binary files /dev/null and b/assets/images/bottom_bar/active/portfolio.png differ diff --git a/assets/images/bottom_bar/active/settings.png b/assets/images/bottom_bar/active/settings.png new file mode 100644 index 0000000..569478f Binary files /dev/null and b/assets/images/bottom_bar/active/settings.png differ diff --git a/assets/images/bottom_bar/active/wallet.png b/assets/images/bottom_bar/active/wallet.png new file mode 100644 index 0000000..dc6320e Binary files /dev/null and b/assets/images/bottom_bar/active/wallet.png differ diff --git a/assets/images/bottom_bar/inactive/academyinactive.png b/assets/images/bottom_bar/inactive/academy.png similarity index 100% rename from assets/images/bottom_bar/inactive/academyinactive.png rename to assets/images/bottom_bar/inactive/academy.png diff --git a/assets/images/bottom_bar/inactive/Investinactive.png b/assets/images/bottom_bar/inactive/invest.png similarity index 100% rename from assets/images/bottom_bar/inactive/Investinactive.png rename to assets/images/bottom_bar/inactive/invest.png diff --git a/assets/images/bottom_bar/inactive/portfolioinactive.png b/assets/images/bottom_bar/inactive/portfolio.png similarity index 100% rename from assets/images/bottom_bar/inactive/portfolioinactive.png rename to assets/images/bottom_bar/inactive/portfolio.png diff --git a/assets/images/bottom_bar/inactive/SettingInactive.png b/assets/images/bottom_bar/inactive/settings.png similarity index 100% rename from assets/images/bottom_bar/inactive/SettingInactive.png rename to assets/images/bottom_bar/inactive/settings.png diff --git a/assets/images/bottom_bar/inactive/InactiveHome.png b/assets/images/bottom_bar/inactive/wallet.png similarity index 100% rename from assets/images/bottom_bar/inactive/InactiveHome.png rename to assets/images/bottom_bar/inactive/wallet.png diff --git a/lib/core/routes/routes.dart b/lib/core/routes/routes.dart index f3dee37..8b19b23 100644 --- a/lib/core/routes/routes.dart +++ b/lib/core/routes/routes.dart @@ -2,7 +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/MainScreens/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'; diff --git a/lib/features/Home/presentation/pages/HomeScreen.dart b/lib/features/Home/presentation/pages/HomeScreen.dart deleted file mode 100644 index 7a26c8c..0000000 --- a/lib/features/Home/presentation/pages/HomeScreen.dart +++ /dev/null @@ -1,22 +0,0 @@ -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 deleted file mode 100644 index d147484..0000000 --- a/lib/features/Home/presentation/pages/MainScreen.dart +++ /dev/null @@ -1,26 +0,0 @@ -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/MainScreens/Academy/presentation/pages/academyScreen.dart b/lib/features/MainScreens/Academy/presentation/pages/academyScreen.dart new file mode 100644 index 0000000..2c81d9b --- /dev/null +++ b/lib/features/MainScreens/Academy/presentation/pages/academyScreen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class AcademyScreen extends StatefulWidget { + const AcademyScreen({super.key}); + + @override + State createState() => _AcademyScreenState(); +} + +class _AcademyScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold(body: Text('Academy'),); + } +} \ No newline at end of file diff --git a/lib/features/MainScreens/Invest/presentation/pages/investScreen.dart b/lib/features/MainScreens/Invest/presentation/pages/investScreen.dart new file mode 100644 index 0000000..3d5570e --- /dev/null +++ b/lib/features/MainScreens/Invest/presentation/pages/investScreen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class InvestScreen extends StatefulWidget { + const InvestScreen({super.key}); + + @override + State createState() => _InvestScreenState(); +} + +class _InvestScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold(body: Text('Invest'),); + } +} \ No newline at end of file diff --git a/lib/features/MainScreens/MainScreen.dart b/lib/features/MainScreens/MainScreen.dart new file mode 100644 index 0000000..a1d6e05 --- /dev/null +++ b/lib/features/MainScreens/MainScreen.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; +import 'package:tanami_app/features/MainScreens/Academy/presentation/pages/academyScreen.dart'; +import 'package:tanami_app/features/MainScreens/Invest/presentation/pages/investScreen.dart'; +import 'package:tanami_app/features/MainScreens/Portfolio/presentation/pages/portfolioScreen.dart'; +import 'package:tanami_app/features/MainScreens/Settings/presentation/pages/settingsScreen.dart'; +import 'package:tanami_app/features/MainScreens/Wallet/presentation/pages/walletScreen.dart'; +import 'package:tanami_app/shared/components/common_bottom_navigation.dart'; + +var currentTab = [ + const WalletScreen(), + const PortfolioScreen(), + const InvestScreen(), + const AcademyScreen(), + const SettingsScreen(), +]; + +var selectedIndex = 1; + +void updateTab(int index) { + selectedIndex = index; +} + +class MainScreen extends StatelessWidget { + const MainScreen({super.key}); + @override + Widget build(BuildContext context) { + return Scaffold( + body: currentTab[selectedIndex], + bottomNavigationBar: bottomnavigationbar(selectedIndex), + ); + } +} diff --git a/lib/features/MainScreens/Portfolio/presentation/pages/portfolioScreen.dart b/lib/features/MainScreens/Portfolio/presentation/pages/portfolioScreen.dart new file mode 100644 index 0000000..c46f5dc --- /dev/null +++ b/lib/features/MainScreens/Portfolio/presentation/pages/portfolioScreen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class PortfolioScreen extends StatefulWidget { + const PortfolioScreen({super.key}); + + @override + State createState() => _PortfolioScreenState(); +} + +class _PortfolioScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold(body: Text('Portfolio'),); + } +} \ No newline at end of file diff --git a/lib/features/MainScreens/Settings/presentation/pages/settingsScreen.dart b/lib/features/MainScreens/Settings/presentation/pages/settingsScreen.dart new file mode 100644 index 0000000..ec3e19c --- /dev/null +++ b/lib/features/MainScreens/Settings/presentation/pages/settingsScreen.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; + +class SettingsScreen extends StatefulWidget { + const SettingsScreen({super.key}); + + @override + State createState() => _SettingsScreenState(); +} + +class _SettingsScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + body: Text('Settings'), + ); + } +} diff --git a/lib/features/MainScreens/Wallet/presentation/pages/walletScreen.dart b/lib/features/MainScreens/Wallet/presentation/pages/walletScreen.dart new file mode 100644 index 0000000..dec5122 --- /dev/null +++ b/lib/features/MainScreens/Wallet/presentation/pages/walletScreen.dart @@ -0,0 +1,15 @@ +import 'package:flutter/material.dart'; + +class WalletScreen extends StatefulWidget { + const WalletScreen({super.key}); + + @override + State createState() => _WalletScreenState(); +} + +class _WalletScreenState extends State { + @override + Widget build(BuildContext context) { + return Scaffold(body: Text('Wallet'),); + } +} \ No newline at end of file diff --git a/lib/shared/components/common_bottom_navigation.dart b/lib/shared/components/common_bottom_navigation.dart index aefd672..2e6d7f0 100644 --- a/lib/shared/components/common_bottom_navigation.dart +++ b/lib/shared/components/common_bottom_navigation.dart @@ -1,251 +1,97 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:tanami_app/features/Home/presentation/pages/MainScreen.dart'; +import 'package:tanami_app/features/MainScreens/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', - ), - ], +Widget bottomnavigationbar(selectedIndex) { + return BottomNavigationBar( + type: BottomNavigationBarType.fixed, + showUnselectedLabels: true, + selectedItemColor: Color(0xFF0B8933), + 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(0xFF0B8933), + fontWeight: FontWeight.w400, + fontFamily: 'hiragino', + ), + currentIndex: selectedIndex, + onTap: (index) { + updateTab(index); + }, + items: [ + BottomNavigationBarItem( + icon: Image.asset( + 'assets/images/bottom_bar/inactive/wallet.png', + height: 26.h, + width: 26.w, + ), + activeIcon: Image.asset( + 'assets/images/bottom_bar/active/wallet.png', + height: 30.h, + width: 30.w, + ), + label: 'Wallet', + ), + BottomNavigationBarItem( + icon: Image.asset( + 'assets/images/bottom_bar/inactive/portfolio.png', + height: 26.h, + width: 26.w, + ), + activeIcon: Image.asset( + 'assets/images/bottom_bar/active/portfolio.png', + height: 30.h, + width: 30.w, + ), + label: 'Portfolio', + ), + 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, + ), + + // SvgPicture.asset('assets/image/svg/active_shortTrade.svg'), + label: 'Invest', + ), + BottomNavigationBarItem( + icon: Image.asset( + 'assets/images/bottom_bar/inactive/academy.png', + height: 26.h, + width: 26.w, + ), + activeIcon: Image.asset( + 'assets/images/bottom_bar/active/academy.png', + height: 30.h, + width: 30.w, + ), + label: 'Academy', + ), + 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, + ), + label: 'Settings', + ), + ], ); } diff --git a/pubspec.yaml b/pubspec.yaml index c3a211b..699f049 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -90,9 +90,8 @@ flutter: - assets/images/welcome_screen/png/ - assets/images/auth_screen/ - assets/images/auth_screen/svg/ - - assets/images/auth_screen/png/ - assets/images/country_flag/ - assets/images/country_flag/svg/ - assets/images/country_flag/png/ - - assets/images/bottom_bar/inactive - - assets/images/bottom_bar/active + - assets/images/bottom_bar/active/ + - assets/images/bottom_bar/inactive/