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(
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<QuestionsListWidget> {
//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<QuestionsListWidget> {
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,