Browse Source

fix: guider

pull/46/head
AmirrezaChegini 6 days ago
parent
commit
3eb3be9f1f
  1. 8
      lib/core/widgets/answer_box/answer_box.dart
  2. 5
      lib/features/question/presentation/ui/screens/question_screen.dart

8
lib/core/widgets/answer_box/answer_box.dart

@ -16,6 +16,7 @@ class AnswerBox extends StatefulWidget {
required this.correctAnswer, required this.correctAnswer,
required this.index, required this.index,
required this.globalKey, required this.globalKey,
required this.answerGlobalKey,
this.onTap, this.onTap,
this.onNotifTap, this.onNotifTap,
}); });
@ -26,6 +27,7 @@ class AnswerBox extends StatefulWidget {
final int index; final int index;
final Function(AnswerEntity answer)? onNotifTap; final Function(AnswerEntity answer)? onNotifTap;
final GlobalKey globalKey; final GlobalKey globalKey;
final GlobalKey answerGlobalKey;
@override @override
State<AnswerBox> createState() => _AnswerBoxState(); State<AnswerBox> createState() => _AnswerBoxState();
@ -55,7 +57,10 @@ class _AnswerBoxState extends State<AnswerBox> {
child: Stack( child: Stack(
alignment: Alignment.topCenter, alignment: Alignment.topCenter,
children: [ children: [
AnswerPictureBox(
MyShowcaseWidget(
globalKey: widget.answerGlobalKey,
description: context.translate.showcase_answer,
child: AnswerPictureBox(
selected: selected, selected: selected,
index: widget.index, index: widget.index,
image: widget.answer.image ?? '', image: widget.answer.image ?? '',
@ -64,6 +69,7 @@ class _AnswerBoxState extends State<AnswerBox> {
widget.onNotifTap?.call(widget.answer); widget.onNotifTap?.call(widget.answer);
}, },
), ),
),
Positioned( Positioned(
left: 0, left: 0,
right: 0, right: 0,

5
lib/features/question/presentation/ui/screens/question_screen.dart

@ -161,11 +161,9 @@ class _QuestionScreenState extends State<QuestionScreen> with TickerProviderStat
key: Key('${state.currentQuestion?.id}'), key: Key('${state.currentQuestion?.id}'),
controller: context.read<QuestionBloc>().answerAnimationController, controller: context.read<QuestionBloc>().answerAnimationController,
index: index, index: index,
child: MyShowcaseWidget(
globalKey: context.read<QuestionBloc>().showCaseKey['answer_key_$index']!,
description: context.translate.showcase_answer,
child: AnswerBox( child: AnswerBox(
globalKey: context.read<QuestionBloc>().showCaseKey['notif_key_$index']!, globalKey: context.read<QuestionBloc>().showCaseKey['notif_key_$index']!,
answerGlobalKey: context.read<QuestionBloc>().showCaseKey['answer_key_$index']!,
index: state.currentQuestion?.answers?[index].order ?? 1, index: state.currentQuestion?.answers?[index].order ?? 1,
answer: answer:
state.currentQuestion?.answers?[index] ?? state.currentQuestion?.answers?[index] ??
@ -184,7 +182,6 @@ class _QuestionScreenState extends State<QuestionScreen> with TickerProviderStat
), ),
), ),
), ),
),
); );
} }

Loading…
Cancel
Save