Browse Source

fix: home page

pull/14/head
AmirrezaChegini 3 days ago
parent
commit
1e7c8388b7
  1. 2
      lib/core/widgets/about_us_dialog/about_us_dialog.dart
  2. 5
      lib/features/home/presentation/bloc/home_bloc.dart
  3. 18
      lib/features/home/presentation/ui/home_page.dart
  4. 3
      lib/l10n/app_en.arb
  5. 6
      lib/l10n/app_localizations.dart
  6. 3
      lib/l10n/app_localizations_en.dart

2
lib/core/widgets/about_us_dialog/about_us_dialog.dart

@ -58,7 +58,7 @@ class AboutUsDialog extends StatelessWidget {
), ),
MyImage( MyImage(
image: MyAssets.newHorizon, image: MyAssets.newHorizon,
size: 70,
size: 45,
), ),
MyImage( MyImage(
image: MyAssets.khadijeLogo, image: MyAssets.khadijeLogo,

5
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:go_router/go_router.dart';
import 'package:hadi_hoda_flutter/core/routers/my_routes.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/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/entity/home_entity.dart';
import 'package:hadi_hoda_flutter/features/home/domain/usecases/get_home_usecase.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'; import 'package:hadi_hoda_flutter/features/home/presentation/bloc/home_event.dart';
@ -33,6 +34,10 @@ class HomeBloc extends Bloc<HomeEvent, HomeState> {
context.pushNamed(Routes.languagePage); context.pushNamed(Routes.languagePage);
} }
void showAboutUs(BuildContext context){
showAboutUsDialog(context: context);
}
/// ------------Api Calls------------ /// ------------Api Calls------------
FutureOr<void> _getHomeEvent(event, emit) async { FutureOr<void> _getHomeEvent(event, emit) async {
await _getHomeUseCase(event.homeParams).then( await _getHomeUseCase(event.homeParams).then(

18
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/common_ui/resources/my_colors.dart';
import 'package:hadi_hoda_flutter/core/utils/check_platform.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_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/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'; import 'package:hadi_hoda_flutter/features/home/presentation/bloc/home_bloc.dart';
class HomePage extends StatelessWidget { class HomePage extends StatelessWidget {
@ -77,17 +80,16 @@ class HomePage extends StatelessWidget {
size: checkSize(context: context, tablet: 120), size: checkSize(context: context, tablet: 120),
), ),
), ),
MyButton(
type: ButtonType.type2,
title: context.translate.start,
),
InkWell( InkWell(
onTap: () => context.read<HomeBloc>().showAboutUs(context),
child: MyImage( 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<HomeBloc>(context).goToLevelPage(context),
),
MyImage(
image: MyAssets.theme,
size: checkSize(context: context, tablet: 120),
), ),
], ],
), ),

3
lib/l10n/app_en.arb

@ -8,5 +8,6 @@
"downloading_data": "Downloading initial data", "downloading_data": "Downloading initial data",
"lost_connection": "Lost connection!", "lost_connection": "Lost connection!",
"try_again": "Try Again", "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"
} }

6
lib/l10n/app_localizations.dart

@ -153,6 +153,12 @@ abstract class AppLocalizations {
/// In en, this message translates to: /// In en, this message translates to:
/// **'You must be connected to the internet to download the initial game data.'** /// **'You must be connected to the internet to download the initial game data.'**
String get connected_to_internet; String get connected_to_internet;
/// No description provided for @start.
///
/// In en, this message translates to:
/// **'Start'**
String get start;
} }
class _AppLocalizationsDelegate class _AppLocalizationsDelegate

3
lib/l10n/app_localizations_en.dart

@ -39,4 +39,7 @@ class AppLocalizationsEn extends AppLocalizations {
@override @override
String get connected_to_internet => String get connected_to_internet =>
'You must be connected to the internet to download the initial game data.'; 'You must be connected to the internet to download the initial game data.';
@override
String get start => 'Start';
} }
Loading…
Cancel
Save