diff --git a/lib/core/widgets/app_bar/my_app_bar.dart b/lib/core/widgets/app_bar/my_app_bar.dart index e4760de..784fa36 100644 --- a/lib/core/widgets/app_bar/my_app_bar.dart +++ b/lib/core/widgets/app_bar/my_app_bar.dart @@ -36,6 +36,7 @@ class MyAppBar extends StatelessWidget implements PreferredSizeWidget { backgroundColor: backgroundColor, centerTitle: true, titleSpacing: MySpaces.s30, + scrolledUnderElevation: 0, title: AppBarType.title( title: title, diamondNumber: diamondNumber, diff --git a/lib/features/home/presentation/controller/home_controller.dart b/lib/features/home/presentation/controller/home_controller.dart index ce21b15..f221868 100644 --- a/lib/features/home/presentation/controller/home_controller.dart +++ b/lib/features/home/presentation/controller/home_controller.dart @@ -1,6 +1,7 @@ import 'package:flutter/cupertino.dart'; import 'package:get/get.dart'; import 'package:shia_game_flutter/core/params/home_params.dart'; +import 'package:shia_game_flutter/core/routers/my_routes.dart'; import 'package:shia_game_flutter/core/status/base_status.dart'; import 'package:shia_game_flutter/features/home/domain/entity/home_entity.dart'; import 'package:shia_game_flutter/features/home/domain/usecases/get_home_usecase.dart'; @@ -35,6 +36,9 @@ class HomeController extends GetxController with StateMixin { final Rx getHomeStatus = Rx(const BaseInit()); /// ------ Functions ------ + void goToBattleLeaguePage() { + Get.toNamed(Routes.battleLeaguePage); + } /// ------ Api Calls ------ Future getHome() async { diff --git a/lib/features/home/presentation/pages/home_page.dart b/lib/features/home/presentation/pages/home_page.dart index b7af715..f359ea2 100644 --- a/lib/features/home/presentation/pages/home_page.dart +++ b/lib/features/home/presentation/pages/home_page.dart @@ -25,7 +25,9 @@ class HomePage extends GetView { const MyImage(asset: MyAssets.shiaMindGroup), MySpaces.s40.gapHeight, const HomeMembership(), - const HomeBattleLeague(), + HomeBattleLeague( + onTap: controller.goToBattleLeaguePage, + ), MySpaces.s20.gapHeight, _customWidgets(context), MySpaces.s20.gapHeight, diff --git a/lib/features/home/presentation/pages/widgets/home_battle_league.dart b/lib/features/home/presentation/pages/widgets/home_battle_league.dart index 76093b1..8942659 100644 --- a/lib/features/home/presentation/pages/widgets/home_battle_league.dart +++ b/lib/features/home/presentation/pages/widgets/home_battle_league.dart @@ -10,7 +10,9 @@ import 'package:shia_game_flutter/core/widgets/image/my_image.dart'; import 'package:shia_game_flutter/core/widgets/text/gradient_text.dart'; class HomeBattleLeague extends StatelessWidget { - const HomeBattleLeague({super.key}); + const HomeBattleLeague({super.key, this.onTap}); + + final VoidCallback? onTap; @override Widget build(BuildContext context) { @@ -18,6 +20,7 @@ class HomeBattleLeague extends StatelessWidget { alignment: AlignmentDirectional.bottomEnd, children: [ MyContainer( + onTap: onTap, width: context.widthScreen, height: 120, padding: const EdgeInsets.symmetric( diff --git a/lib/features/master/presentation/ui/master_page.dart b/lib/features/master/presentation/ui/master_page.dart index 79786e2..1795fec 100644 --- a/lib/features/master/presentation/ui/master_page.dart +++ b/lib/features/master/presentation/ui/master_page.dart @@ -1,6 +1,8 @@ import 'package:flutter/material.dart'; +import 'package:shia_game_flutter/common_ui/theme/my_theme.dart'; import 'package:shia_game_flutter/core/routers/my_routes.dart'; -import 'package:shia_game_flutter/core/widgets/app_bar/styles/master_app_bar.dart'; +import 'package:shia_game_flutter/core/widgets/app_bar/enums/app_bar_type.dart'; +import 'package:shia_game_flutter/core/widgets/app_bar/my_app_bar.dart'; import 'package:shia_game_flutter/core/widgets/bottom_nav_bar/bottom_nav_bar.dart'; import 'package:shia_game_flutter/features/master/presentation/controller/master_controller.dart'; import 'package:get/get.dart'; @@ -12,7 +14,10 @@ class MasterPage extends GetView { Widget build(BuildContext context) { return Scaffold( resizeToAvoidBottomInset: false, - appBar: const MasterAppBar(), + appBar: MyAppBar( + type: AppBarType.master, + backgroundColor: context.backgroundColor, + ), bottomNavigationBar: const BottomNavBar(), body: GetRouterOutlet( initialRoute: Routes.homePage, diff --git a/lib/init_bindings.dart b/lib/init_bindings.dart index 213f6b3..fc3a664 100644 --- a/lib/init_bindings.dart +++ b/lib/init_bindings.dart @@ -74,7 +74,7 @@ void initBindings() { Get.lazyPut(() => GetProfileUseCase(Get.find()), fenix: true); /// ----- BattleLeague Feature ----- - Get.lazyPut(() => BattleLeagueDatasourceImpl(Get.find())); - Get.lazyPut(() => BattleLeagueRepositoryImpl(Get.find())); - Get.lazyPut(() => GetBattleLeagueUseCase(Get.find())); + Get.lazyPut(() => BattleLeagueDatasourceImpl(Get.find()), fenix: true); + Get.lazyPut(() => BattleLeagueRepositoryImpl(Get.find()), fenix: true); + Get.lazyPut(() => GetBattleLeagueUseCase(Get.find()), fenix: true); } diff --git a/lib/main.dart b/lib/main.dart index 2939bb2..98bea17 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -31,7 +31,7 @@ class MainApp extends StatelessWidget { fallbackLocale: const Locale('en', 'US'), supportedLocales: const [Locale('en', 'US')], getPages: appPages, - initialRoute: Routes.battleLeaguePage, + initialRoute: Routes.masterPage, localizationsDelegates: const [ AppLocalizations.delegate, GlobalMaterialLocalizations.delegate,