From 1e7c8388b7008ac2c225d9819b69375ea094c5b9 Mon Sep 17 00:00:00 2001 From: AmirrezaChegini Date: Mon, 6 Oct 2025 08:54:48 +0330 Subject: [PATCH] fix: home page --- .../about_us_dialog/about_us_dialog.dart | 2 +- .../home/presentation/bloc/home_bloc.dart | 5 +++++ .../home/presentation/ui/home_page.dart | 18 ++++++++++-------- lib/l10n/app_en.arb | 3 ++- lib/l10n/app_localizations.dart | 6 ++++++ lib/l10n/app_localizations_en.dart | 3 +++ 6 files changed, 27 insertions(+), 10 deletions(-) diff --git a/lib/core/widgets/about_us_dialog/about_us_dialog.dart b/lib/core/widgets/about_us_dialog/about_us_dialog.dart index a982547..ec274f3 100644 --- a/lib/core/widgets/about_us_dialog/about_us_dialog.dart +++ b/lib/core/widgets/about_us_dialog/about_us_dialog.dart @@ -58,7 +58,7 @@ class AboutUsDialog extends StatelessWidget { ), MyImage( image: MyAssets.newHorizon, - size: 70, + size: 45, ), MyImage( image: MyAssets.khadijeLogo, diff --git a/lib/features/home/presentation/bloc/home_bloc.dart b/lib/features/home/presentation/bloc/home_bloc.dart index 7360c97..e6fe3ae 100644 --- a/lib/features/home/presentation/bloc/home_bloc.dart +++ b/lib/features/home/presentation/bloc/home_bloc.dart @@ -4,6 +4,7 @@ import 'package:flutter/cupertino.dart'; import 'package:go_router/go_router.dart'; import 'package:hadi_hoda_flutter/core/routers/my_routes.dart'; import 'package:hadi_hoda_flutter/core/status/base_status.dart'; +import 'package:hadi_hoda_flutter/core/widgets/about_us_dialog/about_us_dialog.dart'; import 'package:hadi_hoda_flutter/features/home/domain/entity/home_entity.dart'; import 'package:hadi_hoda_flutter/features/home/domain/usecases/get_home_usecase.dart'; import 'package:hadi_hoda_flutter/features/home/presentation/bloc/home_event.dart'; @@ -33,6 +34,10 @@ class HomeBloc extends Bloc { context.pushNamed(Routes.languagePage); } + void showAboutUs(BuildContext context){ + showAboutUsDialog(context: context); + } + /// ------------Api Calls------------ FutureOr _getHomeEvent(event, emit) async { await _getHomeUseCase(event.homeParams).then( diff --git a/lib/features/home/presentation/ui/home_page.dart b/lib/features/home/presentation/ui/home_page.dart index 17472af..758c23f 100644 --- a/lib/features/home/presentation/ui/home_page.dart +++ b/lib/features/home/presentation/ui/home_page.dart @@ -4,7 +4,10 @@ import 'package:hadi_hoda_flutter/common_ui/resources/my_assets.dart'; import 'package:hadi_hoda_flutter/common_ui/resources/my_colors.dart'; import 'package:hadi_hoda_flutter/core/utils/check_platform.dart'; import 'package:hadi_hoda_flutter/core/utils/my_image.dart'; +import 'package:hadi_hoda_flutter/core/utils/my_localization.dart'; import 'package:hadi_hoda_flutter/core/utils/screen_size.dart'; +import 'package:hadi_hoda_flutter/core/widgets/button/enum/button_type.dart'; +import 'package:hadi_hoda_flutter/core/widgets/button/my_button.dart'; import 'package:hadi_hoda_flutter/features/home/presentation/bloc/home_bloc.dart'; class HomePage extends StatelessWidget { @@ -77,17 +80,16 @@ class HomePage extends StatelessWidget { size: checkSize(context: context, tablet: 120), ), ), + MyButton( + type: ButtonType.type2, + title: context.translate.start, + ), InkWell( + onTap: () => context.read().showAboutUs(context), child: MyImage( - image: MyAssets.button, - size: checkSize(context: context, mobile: 90, tablet: 160), + image: MyAssets.theme, + size: checkSize(context: context, tablet: 120), ), - onTap: () => - BlocProvider.of(context).goToLevelPage(context), - ), - MyImage( - image: MyAssets.theme, - size: checkSize(context: context, tablet: 120), ), ], ), diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 66f926e..efe6555 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -8,5 +8,6 @@ "downloading_data": "Downloading initial data", "lost_connection": "Lost connection!", "try_again": "Try Again", - "connected_to_internet": "You must be connected to the internet to download the initial game data." + "connected_to_internet": "You must be connected to the internet to download the initial game data.", + "start": "Start" } \ No newline at end of file diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart index 7d3e5a1..8edc5d4 100644 --- a/lib/l10n/app_localizations.dart +++ b/lib/l10n/app_localizations.dart @@ -153,6 +153,12 @@ abstract class AppLocalizations { /// In en, this message translates to: /// **'You must be connected to the internet to download the initial game data.'** String get connected_to_internet; + + /// No description provided for @start. + /// + /// In en, this message translates to: + /// **'Start'** + String get start; } class _AppLocalizationsDelegate diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart index 521588d..d43de00 100644 --- a/lib/l10n/app_localizations_en.dart +++ b/lib/l10n/app_localizations_en.dart @@ -39,4 +39,7 @@ class AppLocalizationsEn extends AppLocalizations { @override String get connected_to_internet => 'You must be connected to the internet to download the initial game data.'; + + @override + String get start => 'Start'; }