Update to float button quiz redo

This commit is contained in:
Fransolet Thomas 2023-03-03 17:02:02 +01:00
parent efa6cfe3f1
commit 38a5609550
2 changed files with 39 additions and 26 deletions

View File

@ -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(

View File

@ -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,
);
}
@ -406,7 +420,6 @@ class _QuizzPageState extends State<QuizzPage> {
),
),
),
if(!showResponses)
Padding(
padding: const EdgeInsets.all(4.0),
child: SizedBox(