|
|
|
@ -7,6 +7,7 @@ import 'package:hadi_hoda_flutter/core/utils/gap.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/core/utils/screen_size.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/core/utils/set_platform_size.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/core/widgets/animations/slide_down_fade.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/core/widgets/pop_scope/my_pop_scope.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/features/question/presentation/bloc/question_bloc.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/features/question/presentation/bloc/question_state.dart'; |
|
|
|
import 'package:hadi_hoda_flutter/features/question/presentation/ui/screens/diamond_screen.dart'; |
|
|
|
@ -23,53 +24,55 @@ class QuestionPage extends StatelessWidget { |
|
|
|
return ShowCaseWidget( |
|
|
|
builder: (context) { |
|
|
|
return Scaffold( |
|
|
|
body: Container( |
|
|
|
height: context.heightScreen, |
|
|
|
width: context.widthScreen, |
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
horizontal: setSize(context: context, |
|
|
|
mobile: MySpaces.s16, |
|
|
|
tablet: MySpaces.s30) ?? 0, |
|
|
|
vertical: setPlatform(android: MySpaces.s20) ?? 0, |
|
|
|
), |
|
|
|
decoration: BoxDecoration( |
|
|
|
gradient: LinearGradient( |
|
|
|
begin: Alignment.topCenter, |
|
|
|
end: Alignment.bottomCenter, |
|
|
|
colors: [Color(0XFF6930DA), Color(0XFF263AA1)], |
|
|
|
body: MyPopScope( |
|
|
|
child: Container( |
|
|
|
height: context.heightScreen, |
|
|
|
width: context.widthScreen, |
|
|
|
padding: EdgeInsets.symmetric( |
|
|
|
horizontal: setSize(context: context, |
|
|
|
mobile: MySpaces.s16, |
|
|
|
tablet: MySpaces.s30) ?? 0, |
|
|
|
vertical: setPlatform(android: MySpaces.s20) ?? 0, |
|
|
|
), |
|
|
|
image: DecorationImage( |
|
|
|
image: AssetImage(MyAssets.pattern), |
|
|
|
scale: 3, |
|
|
|
repeat: ImageRepeat.repeat, |
|
|
|
colorFilter: ColorFilter.mode( |
|
|
|
Colors.black.withValues(alpha: 0.3), |
|
|
|
BlendMode.srcIn, |
|
|
|
decoration: BoxDecoration( |
|
|
|
gradient: LinearGradient( |
|
|
|
begin: Alignment.topCenter, |
|
|
|
end: Alignment.bottomCenter, |
|
|
|
colors: [Color(0XFF6930DA), Color(0XFF263AA1)], |
|
|
|
), |
|
|
|
image: DecorationImage( |
|
|
|
image: AssetImage(MyAssets.pattern), |
|
|
|
scale: 3, |
|
|
|
repeat: ImageRepeat.repeat, |
|
|
|
colorFilter: ColorFilter.mode( |
|
|
|
Colors.black.withValues(alpha: 0.3), |
|
|
|
BlendMode.srcIn, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
child: SafeArea( |
|
|
|
bottom: false, |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
_topButtons(context), |
|
|
|
MySpaces.s10.gapHeight, |
|
|
|
Expanded( |
|
|
|
child: BlocBuilder<QuestionBloc, QuestionState>( |
|
|
|
buildWhen: (previous, current) => |
|
|
|
(previous.currentQuestion?.order != |
|
|
|
current.currentQuestion?.order), |
|
|
|
builder: (context, state) { |
|
|
|
if (state.currentQuestion?.order == |
|
|
|
state.levelEntity?.questions?.length) { |
|
|
|
return DiamondScreen(); |
|
|
|
} else { |
|
|
|
return QuestionScreen(); |
|
|
|
} |
|
|
|
}, |
|
|
|
child: SafeArea( |
|
|
|
bottom: false, |
|
|
|
child: Column( |
|
|
|
children: [ |
|
|
|
_topButtons(context), |
|
|
|
MySpaces.s10.gapHeight, |
|
|
|
Expanded( |
|
|
|
child: BlocBuilder<QuestionBloc, QuestionState>( |
|
|
|
buildWhen: (previous, current) => |
|
|
|
(previous.currentQuestion?.order != |
|
|
|
current.currentQuestion?.order), |
|
|
|
builder: (context, state) { |
|
|
|
if (state.currentQuestion?.order == |
|
|
|
state.levelEntity?.questions?.length) { |
|
|
|
return DiamondScreen(); |
|
|
|
} else { |
|
|
|
return QuestionScreen(); |
|
|
|
} |
|
|
|
}, |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
], |
|
|
|
], |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
), |
|
|
|
|