Browse Source
Merge pull request 'feature/question' (#15) from feature/question into develop
Merge pull request 'feature/question' (#15) from feature/question into develop
Reviewed-on: https://git.nwhco.ir/amirreza.chegini/hade_hoda_flutter/pulls/15pull/16/head
26 changed files with 369 additions and 117 deletions
-
BINassets/images/leaf.png
-
1lib/common_ui/resources/my_assets.dart
-
5lib/common_ui/resources/my_text_style.dart
-
2lib/core/routers/my_routes.dart
-
46lib/core/widgets/answer_box/answer_box.dart
-
97lib/core/widgets/answer_box/styles/picture_box.dart
-
80lib/core/widgets/hadith_dialog/hadith_dialog.dart
-
4lib/features/level/data/datasource/level_datasource.dart
-
30lib/features/level/presentation/bloc/level_bloc.dart
-
1lib/features/level/presentation/bloc/level_event.dart
-
28lib/features/level/presentation/ui/level_page.dart
-
9lib/features/level/presentation/ui/widgets/hint_level_widget.dart
-
4lib/features/level/presentation/ui/widgets/level_widget.dart
-
20lib/features/question/data/datasource/question_datasource.dart
-
11lib/features/question/domain/entity/answer_entity.dart
-
7lib/features/question/domain/entity/answer_entity.g.dart
-
25lib/features/question/presentation/bloc/question_bloc.dart
-
8lib/features/question/presentation/bloc/question_event.dart
-
14lib/features/question/presentation/bloc/question_state.dart
-
34lib/features/question/presentation/ui/question_page.dart
-
22lib/features/question/presentation/ui/widgets/black_white_effect.dart
-
14lib/features/question/presentation/ui/widgets/question_stepper.dart
-
2lib/init_bindings.dart
-
4lib/l10n/app_en.arb
-
12lib/l10n/app_localizations.dart
-
6lib/l10n/app_localizations_en.dart
After Width: 23 | Height: 24 | Size: 436 B |
@ -0,0 +1,80 @@ |
|||||
|
import 'dart:ui'; |
||||
|
|
||||
|
import 'package:flutter/material.dart'; |
||||
|
import 'package:go_router/go_router.dart'; |
||||
|
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_spaces.dart'; |
||||
|
import 'package:hadi_hoda_flutter/common_ui/resources/my_text_style.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/widgets/about_us_dialog/styles/background.dart'; |
||||
|
|
||||
|
Future<void> showHadithDialog({required BuildContext context}) async { |
||||
|
await showDialog( |
||||
|
context: context, |
||||
|
builder: (context) => HadithDialog(), |
||||
|
barrierColor: MyColors.purple.withValues(alpha: 0.82), |
||||
|
useSafeArea: false, |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
class HadithDialog extends StatelessWidget { |
||||
|
const HadithDialog({super.key}); |
||||
|
|
||||
|
@override |
||||
|
Widget build(BuildContext context) { |
||||
|
return Scaffold( |
||||
|
backgroundColor: MyColors.transparent, |
||||
|
body: BackdropFilter( |
||||
|
filter: ImageFilter.blur(sigmaX: 6, sigmaY: 6), |
||||
|
child: Center( |
||||
|
child: Padding( |
||||
|
padding: EdgeInsets.symmetric( |
||||
|
horizontal: checkSize( |
||||
|
context: context, |
||||
|
mobile: 18, |
||||
|
tablet: 120, |
||||
|
) ?? 0, |
||||
|
), |
||||
|
child: Stack( |
||||
|
clipBehavior: Clip.none, |
||||
|
children: [ |
||||
|
AboutUSDialogBackground( |
||||
|
child: ListView.separated( |
||||
|
itemCount: 3, |
||||
|
separatorBuilder: (context, index) => Divider( |
||||
|
height: 40, |
||||
|
thickness: 1, |
||||
|
endIndent: MySpaces.s20, |
||||
|
indent: MySpaces.s20, |
||||
|
color: Color(0xFFC2BDE4), |
||||
|
), |
||||
|
itemBuilder: (context, index) => Text( |
||||
|
'Prophet Muhammad (PBUH) said: "Teeth, which are smooth and beautiful, become dirty as a result of chewing food, and gradually the smell of the mouth changes and causes corruption in the nasal organs. When a person brushes her teeth, the corruption disappears and the teeth become clean and pure again."', |
||||
|
style: Marhey.medium14.copyWith( |
||||
|
color: Color(0XFF494178), |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
Positioned( |
||||
|
right: checkSize(context: context, mobile: 30, tablet: 40), |
||||
|
top: -12, |
||||
|
child: GestureDetector( |
||||
|
onTap: context.pop, |
||||
|
behavior: HitTestBehavior.opaque, |
||||
|
child: MyImage( |
||||
|
image: MyAssets.closeBtn, |
||||
|
size: checkSize(context: context, mobile: 40, tablet: 60), |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
], |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
), |
||||
|
); |
||||
|
} |
||||
|
} |
@ -1,17 +1,11 @@ |
|||||
import 'package:hadi_hoda_flutter/features/question/domain/entity/answer_entity.dart'; |
|
||||
|
|
||||
sealed class QuestionEvent { |
sealed class QuestionEvent { |
||||
const QuestionEvent(); |
const QuestionEvent(); |
||||
} |
} |
||||
|
|
||||
class GetLevelEvent extends QuestionEvent { |
class GetLevelEvent extends QuestionEvent { |
||||
final String? id; |
final String? id; |
||||
|
|
||||
const GetLevelEvent(this.id); |
const GetLevelEvent(this.id); |
||||
} |
} |
||||
|
|
||||
class ChooseAnswerEvent extends QuestionEvent { |
|
||||
final AnswerEntity? answer; |
|
||||
|
|
||||
const ChooseAnswerEvent(this.answer); |
|
||||
|
class ChangeQuestionEvent extends QuestionEvent { |
||||
} |
} |
@ -1,31 +1,27 @@ |
|||||
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/features/level/domain/entity/level_entity.dart'; |
import 'package:hadi_hoda_flutter/features/level/domain/entity/level_entity.dart'; |
||||
import 'package:hadi_hoda_flutter/features/question/domain/entity/answer_entity.dart'; |
|
||||
|
import 'package:hadi_hoda_flutter/features/question/domain/entity/question_entity.dart'; |
||||
|
|
||||
class QuestionState { |
class QuestionState { |
||||
final BaseStatus getQuestionStatus; |
final BaseStatus getQuestionStatus; |
||||
final LevelEntity? levelEntity; |
final LevelEntity? levelEntity; |
||||
final int currentStep; |
|
||||
final AnswerEntity? chooseAnswer; |
|
||||
|
final QuestionEntity? currentQuestion; |
||||
|
|
||||
const QuestionState({ |
const QuestionState({ |
||||
this.getQuestionStatus = const BaseInit(), |
this.getQuestionStatus = const BaseInit(), |
||||
this.levelEntity, |
this.levelEntity, |
||||
this.currentStep = 0, |
|
||||
this.chooseAnswer, |
|
||||
|
this.currentQuestion, |
||||
}); |
}); |
||||
|
|
||||
QuestionState copyWith({ |
QuestionState copyWith({ |
||||
BaseStatus? getQuestionStatus, |
BaseStatus? getQuestionStatus, |
||||
LevelEntity? levelEntity, |
LevelEntity? levelEntity, |
||||
int? currentStep, |
|
||||
AnswerEntity? chooseAnswer, |
|
||||
|
QuestionEntity? currentQuestion, |
||||
}) { |
}) { |
||||
return QuestionState( |
return QuestionState( |
||||
getQuestionStatus: getQuestionStatus ?? this.getQuestionStatus, |
getQuestionStatus: getQuestionStatus ?? this.getQuestionStatus, |
||||
levelEntity: levelEntity ?? this.levelEntity, |
levelEntity: levelEntity ?? this.levelEntity, |
||||
currentStep: currentStep ?? this.currentStep, |
|
||||
chooseAnswer: chooseAnswer ?? this.chooseAnswer, |
|
||||
|
currentQuestion: currentQuestion ?? this.currentQuestion, |
||||
); |
); |
||||
} |
} |
||||
} |
} |
@ -0,0 +1,22 @@ |
|||||
|
import 'package:flutter/material.dart'; |
||||
|
|
||||
|
class BlackWhiteEffect extends StatelessWidget { |
||||
|
const BlackWhiteEffect({super.key, required this.child}); |
||||
|
|
||||
|
final Widget child; |
||||
|
|
||||
|
@override |
||||
|
Widget build(BuildContext context) { |
||||
|
return ColorFiltered( |
||||
|
colorFilter: ColorFilter.matrix( |
||||
|
<double>[ |
||||
|
0.2126, 0.7152, 0.0722, 0, 0, |
||||
|
0.2126, 0.7152, 0.0722, 0, 0, |
||||
|
0.2126, 0.7152, 0.0722, 0, 0, |
||||
|
0, 0, 0, 1, 0, |
||||
|
], |
||||
|
), |
||||
|
child: child, |
||||
|
); |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue