Try fixing layout landscape mode

This commit is contained in:
Fransolet Thomas 2023-03-03 17:26:57 +01:00
parent 24ef94f6af
commit 2b04324ba4

View File

@ -51,14 +51,20 @@ class _QuestionsListWidget extends State<QuestionsListWidget> {
/*return OrientationBuilder( /*return OrientationBuilder(
builder: (context, orientation) {*/ builder: (context, orientation) {*/
return SizedBox( 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, width: double.infinity,
//color: Colors.orange, //color: Colors.orange,
child: Stack( child: Stack(
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: widget.isShowResponse ? MainAxisAlignment.start : MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
if(_questionsSubDTO.isNotEmpty) if(_questionsSubDTO.isNotEmpty)
CarouselSlider( CarouselSlider(
@ -107,7 +113,7 @@ class _QuestionsListWidget extends State<QuestionsListWidget> {
//crossAxisAlignment: CrossAxisAlignment.center, //crossAxisAlignment: CrossAxisAlignment.center,
//mainAxisAlignment: MainAxisAlignment.spaceEvenly, //mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
Container( SizedBox(
//color: Colors.red, //color: Colors.red,
//width: MediaQuery.of(context).size.width *0.65, //width: MediaQuery.of(context).size.width *0.65,
height: MediaQuery.of(context).size.height *0.25, height: MediaQuery.of(context).size.height *0.25,
@ -158,8 +164,20 @@ class _QuestionsListWidget extends State<QuestionsListWidget> {
child: GridView.builder( child: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: widget.orientation == Orientation.portrait ? 1 : 2, // TODO HERE IS TABLET 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 mainAxisExtent: widget.isShowResponse ?
mainAxisSpacing: widget.isShowResponse ? widget.orientation == Orientation.portrait ? 30 : 10 : 32.5, // TODO depends on percentage 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 crossAxisSpacing: widget.isShowResponse ? 0 : 0, // TODO depends on percentage
), ),
itemCount: i.responsesSubDTO!.length, itemCount: i.responsesSubDTO!.length,