From 2b04324ba466e0acaad7090fc67cef19a5883787 Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Fri, 3 Mar 2023 17:26:57 +0100 Subject: [PATCH] Try fixing layout landscape mode --- lib/Screens/Quizz/questions_list.dart | 28 ++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/lib/Screens/Quizz/questions_list.dart b/lib/Screens/Quizz/questions_list.dart index c8f0c8e..2f8e215 100644 --- a/lib/Screens/Quizz/questions_list.dart +++ b/lib/Screens/Quizz/questions_list.dart @@ -51,14 +51,20 @@ class _QuestionsListWidget extends State { /*return OrientationBuilder( builder: (context, orientation) {*/ return SizedBox( - 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, + height: widget.isShowResponse ? + widget.orientation == Orientation.portrait ? + MediaQuery.of(context).size.height * 0.85 : + MediaQuery.of(context).size.height * 0.75 : + widget.orientation == Orientation.portrait ? + MediaQuery.of(context).size.height : + MediaQuery.of(context).size.height, width: double.infinity, //color: Colors.orange, child: Stack( children: [ Column( crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: widget.isShowResponse ? MainAxisAlignment.start : MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ if(_questionsSubDTO.isNotEmpty) CarouselSlider( @@ -107,7 +113,7 @@ class _QuestionsListWidget extends State { //crossAxisAlignment: CrossAxisAlignment.center, //mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Container( + SizedBox( //color: Colors.red, //width: MediaQuery.of(context).size.width *0.65, height: MediaQuery.of(context).size.height *0.25, @@ -158,8 +164,20 @@ class _QuestionsListWidget extends State { child: GridView.builder( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: widget.orientation == Orientation.portrait ? 1 : 2, // TODO HERE IS TABLET - mainAxisExtent: widget.isShowResponse ? widget.orientation == Orientation.portrait ? 60 : 50 : 60, // TODO depends on percentage - mainAxisSpacing: widget.isShowResponse ? widget.orientation == Orientation.portrait ? 30 : 10 : 32.5, // TODO depends on percentage + mainAxisExtent: widget.isShowResponse ? + widget.orientation == Orientation.portrait ? + 60 : + 50 : + widget.orientation == Orientation.portrait ? + 60 : + 60, // TODO depends on percentage + mainAxisSpacing: widget.isShowResponse ? + widget.orientation == Orientation.portrait ? + 30 : + 10 : + widget.orientation == Orientation.portrait ? + 32.5 : + 32.5, // TODO depends on percentage crossAxisSpacing: widget.isShowResponse ? 0 : 0, // TODO depends on percentage ), itemCount: i.responsesSubDTO!.length,