|
|
|
@ -37,6 +37,8 @@ class QuestionScreen extends StatelessWidget { |
|
|
|
spacing: MySpaces.s4, |
|
|
|
children: [ |
|
|
|
BlocBuilder<QuestionBloc, QuestionState>( |
|
|
|
buildWhen: (previous, current) => |
|
|
|
previous.currentQuestion?.id != current.currentQuestion?.id, |
|
|
|
builder: (context, state) => Text( |
|
|
|
'${context.translate.question} ${state.currentQuestion?.order ?? 1} / ${(state.levelEntity?.questions?.length ?? 0) - 1}', |
|
|
|
style: Marhey.medium12.copyWith( |
|
|
|
@ -52,6 +54,8 @@ class QuestionScreen extends StatelessWidget { |
|
|
|
), |
|
|
|
), |
|
|
|
BlocBuilder<QuestionBloc, QuestionState>( |
|
|
|
buildWhen: (previous, current) => |
|
|
|
previous.currentQuestion?.id != current.currentQuestion?.id, |
|
|
|
builder: (context, state) => Text( |
|
|
|
state.currentQuestion?.title ?? '', |
|
|
|
textAlign: TextAlign.center, |
|
|
|
@ -84,6 +88,8 @@ class QuestionScreen extends StatelessWidget { |
|
|
|
globalKey: context.read<QuestionBloc>().keys[index], |
|
|
|
description: context.translate.tap_to_select, |
|
|
|
child: BlocBuilder<QuestionBloc, QuestionState>( |
|
|
|
buildWhen: (previous, current) => |
|
|
|
previous.currentQuestion?.id != current.currentQuestion?.id, |
|
|
|
builder: (context, state) => AnswerBox( |
|
|
|
key: Key('${state.currentQuestion?.id}'), |
|
|
|
index: state.currentQuestion?.answers?[index].order ?? 1, |
|
|
|
@ -105,6 +111,8 @@ class QuestionScreen extends StatelessWidget { |
|
|
|
children: [ |
|
|
|
Spacer(), |
|
|
|
BlocBuilder<QuestionBloc, QuestionState>( |
|
|
|
buildWhen: (previous, current) => |
|
|
|
previous.correctAnswer != current.correctAnswer, |
|
|
|
builder: (context, state) => Stack( |
|
|
|
clipBehavior: Clip.none, |
|
|
|
children: [ |
|
|
|
|