Update to float button quiz redo
This commit is contained in:
parent
efa6cfe3f1
commit
38a5609550
@ -51,7 +51,7 @@ class _QuestionsListWidget extends State<QuestionsListWidget> {
|
||||
/*return OrientationBuilder(
|
||||
builder: (context, orientation) {*/
|
||||
return SizedBox(
|
||||
height: widget.isShowResponse ? widget.orientation == Orientation.portrait ? MediaQuery.of(context).size.height * 0.84 : MediaQuery.of(context).size.height * 0.625 : MediaQuery.of(context).size.height,
|
||||
height: widget.isShowResponse ? widget.orientation == Orientation.portrait ? MediaQuery.of(context).size.height * 0.85 : MediaQuery.of(context).size.height * 0.625 : MediaQuery.of(context).size.height,
|
||||
width: double.infinity,
|
||||
//color: Colors.orange,
|
||||
child: Stack(
|
||||
|
||||
@ -50,6 +50,7 @@ class _QuizzPageState extends State<QuizzPage> {
|
||||
bool showResponses = false;
|
||||
|
||||
bool kIsWeb = false;
|
||||
bool isResultPage = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -184,14 +185,14 @@ class _QuizzPageState extends State<QuizzPage> {
|
||||
// RESPONSE BOX
|
||||
//ShowReponsesWidget(questionsSubDTO: _questionsSubDTO),
|
||||
|
||||
if(orientation == Orientation.portrait)
|
||||
if(orientation == Orientation.portrait && !showResponses)
|
||||
// Buttons
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: resultButtons(size, orientation, visitAppContext!),
|
||||
),
|
||||
if(orientation == Orientation.landscape)
|
||||
if(orientation == Orientation.landscape && !showResponses)
|
||||
// Buttons
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
@ -221,6 +222,19 @@ class _QuizzPageState extends State<QuizzPage> {
|
||||
);
|
||||
}
|
||||
),
|
||||
floatingActionButton: showResponses ? FloatingActionButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
showResult = false;
|
||||
showResponses = false;
|
||||
currentIndex = 1;
|
||||
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO!.questions!);
|
||||
});
|
||||
},
|
||||
backgroundColor: kBackgroundSecondGrey,
|
||||
child: const Icon(Icons.undo),
|
||||
) : null,
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.miniEndFloat,
|
||||
);
|
||||
}
|
||||
|
||||
@ -382,31 +396,30 @@ class _QuizzPageState extends State<QuizzPage> {
|
||||
|
||||
resultButtons(Size size, Orientation orientation, VisitAppContext visitAppContext) {
|
||||
return [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: SizedBox(
|
||||
height: kIsWeb ? 50 : 40,
|
||||
width: orientation == Orientation.portrait ? size.width * 0.6 : size.width * 0.35,
|
||||
child: RoundedButton(
|
||||
text: TranslationHelper.getFromLocale("restart", visitAppContext),
|
||||
color: kBackgroundSecondGrey,
|
||||
textColor: kBackgroundLight,
|
||||
icon: Icons.undo,
|
||||
press: () {
|
||||
setState(() {
|
||||
showResult = false;
|
||||
showResponses = false;
|
||||
currentIndex = 1;
|
||||
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO!.questions!);
|
||||
});
|
||||
},
|
||||
fontSize: 18,
|
||||
horizontal: 20,
|
||||
vertical: 5
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4),
|
||||
child: SizedBox(
|
||||
height: kIsWeb ? 50 : 40,
|
||||
width: orientation == Orientation.portrait ? size.width * 0.6 : size.width * 0.35,
|
||||
child: RoundedButton(
|
||||
text: TranslationHelper.getFromLocale("restart", visitAppContext),
|
||||
color: kBackgroundSecondGrey,
|
||||
textColor: kBackgroundLight,
|
||||
icon: Icons.undo,
|
||||
press: () {
|
||||
setState(() {
|
||||
showResult = false;
|
||||
showResponses = false;
|
||||
currentIndex = 1;
|
||||
_questionsSubDTO = QuestionSubDTO().fromJSON(quizzDTO!.questions!);
|
||||
});
|
||||
},
|
||||
fontSize: 18,
|
||||
horizontal: 20,
|
||||
vertical: 5
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if(!showResponses)
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(4.0),
|
||||
child: SizedBox(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user