|
|
|
@ -91,28 +91,30 @@ class _QuestionScreenState extends State<QuestionScreen> with TickerProviderStat |
|
|
|
} |
|
|
|
|
|
|
|
Widget _questionImage(BuildContext context) { |
|
|
|
return Column( |
|
|
|
return FadeAnimDelayed( |
|
|
|
duration: const Duration(seconds: 1), |
|
|
|
child: FadeAnimController( |
|
|
|
controller: context.read<QuestionBloc>().imageAnimationController, |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
10.0.gapHeight, |
|
|
|
_titles(context), |
|
|
|
const Spacer(), |
|
|
|
BlocBuilder<QuestionBloc, QuestionState>( |
|
|
|
builder: (context, state) => FadeAnimDelayed( |
|
|
|
duration: const Duration(seconds: 1), |
|
|
|
child: FadeAnimController( |
|
|
|
builder: (context, state) => AnswerPictureBox( |
|
|
|
key: Key('${state.currentQuestion?.image}'), |
|
|
|
controller: context.read<QuestionBloc>().imageAnimationController, |
|
|
|
child: AnswerPictureBox( |
|
|
|
selected: false, |
|
|
|
showIndex: false, |
|
|
|
correctAnswer: 0, |
|
|
|
index: 0, |
|
|
|
image: state.currentQuestion?.image ?? '', |
|
|
|
autostart: Autostart.once, |
|
|
|
), |
|
|
|
), |
|
|
|
autostart: Autostart.loop, |
|
|
|
), |
|
|
|
), |
|
|
|
const Spacer(), |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ -133,9 +135,8 @@ class _QuestionScreenState extends State<QuestionScreen> with TickerProviderStat |
|
|
|
return BlocBuilder<QuestionBloc, QuestionState>( |
|
|
|
buildWhen: (previous, current) => |
|
|
|
previous.currentQuestion?.id != current.currentQuestion?.id, |
|
|
|
builder: (context, state) => FadeAnimController( |
|
|
|
controller: context.read<QuestionBloc>().answerAnimationController, |
|
|
|
child: Text( |
|
|
|
builder: (context, state) => |
|
|
|
Text( |
|
|
|
state.currentQuestion?.title ?? '', |
|
|
|
textAlign: TextAlign.center, |
|
|
|
style: MYTextStyle.titr1.copyWith( |
|
|
|
@ -147,15 +148,19 @@ class _QuestionScreenState extends State<QuestionScreen> with TickerProviderStat |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Widget _answers(BuildContext context) { |
|
|
|
return ListView( |
|
|
|
controller: context.read<QuestionBloc>().scrollController, |
|
|
|
padding: const EdgeInsets.only(top: 10), |
|
|
|
children: [ |
|
|
|
_titles(context), |
|
|
|
30.0.gapHeight, |
|
|
|
FadeAnimController( |
|
|
|
controller: context.read<QuestionBloc>().answerAnimationController, |
|
|
|
child: _titles(context), |
|
|
|
), |
|
|
|
50.0.gapHeight, |
|
|
|
BlocBuilder<QuestionBloc, QuestionState>( |
|
|
|
buildWhen: (previous, current) => |
|
|
|
previous.currentQuestion?.id != current.currentQuestion?.id, |
|
|
|
|