I want to increase the size of my menu to be full screen instead of it’s current size. This is my current code:
import 'package:flutter/material.dart';
import 'package:shot_planner/Project%20Page/Project/Project%20Page.dart';
import 'package:shot_planner/Shot%20List%20Page/Menu/Camera%20Menu%20-%20Phone.dart';
import 'package:shot_planner/Shot%20List%20Page/Menu/Special%20Equipment%20Menu%20-%20Phone.dart';
import 'package:shot_planner/Shot%20List%20Page/Menu/VFX%20Menu%20-%20Phone.dart';
bool shotAddInfoMenuVisible = false;
//----------------------| AddInfoMenu Widget |--------------------------------------------------------------------
class AddInfoMenuPhone extends StatefulWidget {
int shotlistindex;
int projectindex;
List<List<FocusNode>> addInfoFocusNodeList;
ShotListState shotListState;
Function(String)? onMoreDetailsChosen;
Function(bool)? onTextDetailsChosen;
AddInfoMenuPhone(this.shotlistindex, this.projectindex,
this.addInfoFocusNodeList, this.shotListState,
{this.onMoreDetailsChosen, this.onTextDetailsChosen});
@override
State<StatefulWidget> createState() => _AddInfoMenuPhoneState();
}
//----------------------| AddInfoState State |----------------------------------------------------------------
class _AddInfoMenuPhoneState extends State<AddInfoMenuPhone> {
@override
void initState() {
print("pop");
super.initState();
}
//MediaQuery.of(context).size.width,
BottomBar(Widget popupmenu) {
showModalBottomSheet(
isScrollControlled: true,
backgroundColor: Colors.transparent,
context: context,
builder: (context) {
return Container(
height: MediaQuery.of(context).size.height,
width: MediaQuery.of(context).size.width,
child: popupmenu,
);
});
}
@override
Widget build(BuildContext context) {
if (widget
.shotListState
.addinfoitemgroup[widget.shotlistindex][widget.projectindex]
.length <=
4) {}
// TODO: implement build
return Container(
decoration: BoxDecoration(
color: Color(0xff1C1C1C),
borderRadius: BorderRadius.all(Radius.circular(20))),
// color: Color.fromARGB(255, 35, 35, 35),
child: Expanded(
//----------------------| Close button |-------------------------------------------------------
child: Container(
child: Column(
children: [
SizedBox(height: 20),
Align(
alignment: Alignment.topRight,
child: Container(
width: 20,
height: 20,
margin: EdgeInsets.only(right: 20, top: 10),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.grey[400]
),
child: IconButton(
padding: EdgeInsets.zero,
onPressed: () {
Navigator.of(context).pop();
},
icon: Icon(
Icons.close,
size: 12,
color: Colors.black
),
),
),
),
SizedBox(height: 20),
Expanded(
child: SingleChildScrollView(
//----------------------| Option lists |--------------------------------------------------------------------
child: Container(
width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration(
color: Colors.grey[850],
borderRadius: BorderRadius.circular(10)
),
child: ListView.builder(
padding: EdgeInsets.zero,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: widget
.shotListState
.addinfoitemgroup[widget.shotlistindex][widget.projectindex]
.length,
itemBuilder: (BuildContext context, int index) {
return Column(
children: [
Material(
color: Colors.transparent,
child: ListTile(
contentPadding:
EdgeInsets.symmetric(vertical: 5, horizontal: 16),
dense: true,
visualDensity:
VisualDensity(vertical: -3),
title: Text(
widget.shotListState.addinfoitemgroup[widget.shotlistindex]
[widget.projectindex][index]
.toString(),
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
onTap: () {
setState(() {
//----------------------| Toggle selection logic here |----------------------------------
widget.shotListState.getprojectindex[widget.shotlistindex] =
widget.projectindex;
if (widget.shotListState
.addinfoitemgroup[widget.shotlistindex]
[widget.projectindex][index] ==
'Special Equipment') {
widget
.shotListState
.addinfolistname[widget.shotlistindex]
[widget.projectindex]
.add('Special Equipment');
} else {
widget
.shotListState
.addinfolistname[widget.shotlistindex]
[widget.projectindex]
.add(widget.shotListState
.addinfoitemgroup[widget.shotlistindex]
[widget.projectindex][index]);
}
widget
.shotListState
.infonamelistpdf[widget.shotlistindex]
[widget.projectindex]
.add(widget.shotListState
.addinfoitemgroup[widget.shotlistindex]
[widget.projectindex][index]);
widget
.shotListState
.infoitemlistpdf[widget.shotlistindex]
[widget.projectindex]
.add('Add');
widget
.shotListState
.getoptionselection[widget.shotlistindex]
[widget.projectindex]
.add([
widget.shotListState
.addinfoitemgroupoption[widget.shotlistindex]
[widget.projectindex][index]
]);
widget
.shotListState
.getoptionsubtitle[widget.shotlistindex]
[widget.projectindex]
.add(['']);
List<bool> gettotalbool = [];
for (int i = 0;
i <
widget
.shotListState
.addinfoitemgroupoption[widget.shotlistindex]
[widget.projectindex][index]
.length;
i++) {
gettotalbool.add(false);
}
widget
.shotListState
.addinfolistitem[widget.shotlistindex]
[widget.projectindex]
.add('');
/*addInfoFocusNode.add(FocusNode());
Future.delayed(const Duration(milliseconds: 100), () {
addInfoFocusNode.last.requestFocus();
});
addInfoController.add(TextEditingController());*/
widget
.shotListState
.finalinputcustomize[widget.shotlistindex]
[widget.projectindex]
.add(false);
/*WidgetsBinding.instance.addPostFrameCallback(
(_) => scrollToEnd(widget.projectindex));*/
widget.shotListState
.shotlist[widget.shotlistindex][widget.projectindex]
.add([gettotalbool]);
widget
.shotListState
.addinfoitemgroup[widget.shotlistindex]
[widget.projectindex]
.removeAt(index);
widget
.shotListState
.addinfoitemgroupoption[widget.shotlistindex]
[widget.projectindex]
.removeAt(index);
if (widget
.shotListState
.addinfoitemgroup[widget.shotlistindex]
[widget.projectindex]
.length <
4) {
//globals.slidingpanelmaxheight -= 65;
}
widget.shotListState.inputlistenable.value += 1;
int x = widget
.shotListState
.finalinputcustomize[widget.shotlistindex]
[widget.projectindex]
.length;
int y = widget
.shotListState
.addinfolistname[widget.shotlistindex]
[widget.projectindex]
.length;
if (widget.shotListState.scenepageedit[widget.shotlistindex]
[widget.projectindex]) {
for (int i = 0;
i <
widget
.shotListState
.finalinputcustomize[widget.shotlistindex]
[widget.projectindex]
.length;
i++) {
widget.shotListState
.finalinputcustomize[widget.shotlistindex]
[widget.projectindex][i] = false;
}
widget.shotListState.inputtype = y - 1 + 6;
widget.shotListState
.getprojectindex[widget.shotlistindex] =
widget.projectindex;
widget.shotListState.gettitle = widget.shotListState
.addinfolistname[widget.shotlistindex]
[widget.projectindex][y - 1];
if (widget.shotListState.addinfolistname[widget.shotlistindex][widget.projectindex][y - 1] == 'Subject' ||
widget.shotListState.addinfolistname[widget.shotlistindex][widget.projectindex][y - 1] ==
'Sound' ||
widget.shotListState.addinfolistname[widget.shotlistindex]
[widget.projectindex][y - 1] ==
'Lighting' ||
widget.shotListState.addinfolistname[widget.shotlistindex]
[widget.projectindex][y - 1] ==
'Location') {
widget.onTextDetailsChosen?.call(true);
Navigator.pop(context);
widget.shotListState
.finalinputcustomize[widget.shotlistindex]
[widget.projectindex][x - 1] = true;
// scenepageimagecamera.value +=1;
Future.delayed(const Duration(milliseconds: 300), () {
double boxesAboveEditingBoxTotalHeigh = 0;
double editingBoxAdditionalInfoTotalHeight = 0;
double totalOffset = 0;
// calculate total height of shot-boxes above the editing shot-box
for (int shotIndex = 0;
shotIndex < widget.projectindex;
shotIndex++) {
// if shot-container-more-detail is opened
if (widget.shotListState.shotdropdownvisibility[
widget.shotlistindex][shotIndex]) {
// 795 = height of shot-box without any additional info
boxesAboveEditingBoxTotalHeigh += 795;
for (int addInfoIndex = 0;
addInfoIndex <
widget
.shotListState
.addinfolistname[widget.shotlistindex]
[shotIndex]
.length;
addInfoIndex++) {
// 58 = height of a additional info
boxesAboveEditingBoxTotalHeigh += 58;
}
}
// if shot-container-more-detail is closed
else {
// 90 = height of shot-box when it is closed
boxesAboveEditingBoxTotalHeigh += 90;
}
}
// calculate total height of additional info boxes in the editing shot-box
for (int editingAddInfoIndex = 0;
editingAddInfoIndex <
widget
.shotListState
.addinfolistname[widget.shotlistindex]
[widget.projectindex]
.length;
editingAddInfoIndex++) {
// 58 = height of a additional info
editingBoxAdditionalInfoTotalHeight += 58;
}
// calculate the offset value for the scroll
totalOffset = boxesAboveEditingBoxTotalHeigh +
editingBoxAdditionalInfoTotalHeight;
// scroll page to the calculated offset
widget.shotListState.shotitemcontroller
.jumpTo(totalOffset);
});
} else if (widget.shotListState.addinfolistname[widget.shotlistindex]
[widget.projectindex][y - 1] ==
'VFX') {
widget.shotListState.slidingpanelmaxheight += 151;
Navigator.pop(context);
BottomBar(VFXMenu(
widget.shotListState.inputvisible,
widget.shotlistindex,
widget.shotListState
.getprojectindex[widget.shotlistindex],
widget.shotListState.inputtype,
widget.shotListState.gettitle,
widget.addInfoFocusNodeList,
widget.shotListState,
onMoreDetailsChosen: (moreDetailChoice) => widget
.onMoreDetailsChosen
?.call(moreDetailChoice),
));
} else if (widget.shotListState.addinfolistname[widget.shotlistindex]
[widget.projectindex][y - 1] ==
'Camera') {
widget.shotListState.slidingpanelmaxheight += 151;
Navigator.pop(context);
BottomBar(CameraMenu(
widget.shotListState.inputvisible,
widget.shotlistindex,
widget.shotListState
.getprojectindex[widget.shotlistindex],
widget.shotListState.inputtype,
widget.shotListState.gettitle,
widget.addInfoFocusNodeList,
widget.shotListState,
onMoreDetailsChosen: (moreDetailChoice) => widget
.onMoreDetailsChosen
?.call(moreDetailChoice),
));
} else if (widget.shotListState.addinfolistname[widget.shotlistindex]
[widget.projectindex][y - 1] ==
'Special Equipment') {
widget.shotListState.slidingpanelmaxheight += 151;
Navigator.pop(context);
BottomBar(SpecialEquipmentMenu(
widget.shotListState.inputvisible,
widget.shotlistindex,
widget.shotListState
.getprojectindex[widget.shotlistindex],
widget.shotListState.inputtype,
widget.shotListState.gettitle,
widget.addInfoFocusNodeList,
widget.shotListState,
onMoreDetailsChosen: (moreDetailChoice) => widget
.onMoreDetailsChosen
?.call(moreDetailChoice),
));
}
widget.shotListState.slidingpanelmaxheight = 1000;
if (widget.shotListState.inputvisible) {
//globals.slidingpanelscrollcontroller.open();
} else {
widget.shotListState.slidingpanelscrollcontroller
.close();
}
/*WidgetsBinding.instance.addPostFrameCallback(
(_) => scrollToEnd(widget.projectindex));*/
}
if (widget.projectindex ==
widget
.shotListState
.projectpagelist[widget.shotlistindex]
.length -
1 &&
widget
.shotListState
.addinfolistname[widget.shotlistindex]
[widget.projectindex]
.length <
5) {
widget.shotListState.parallaxoffsetproject =
1.5 + (0.21 * (y / 2.round() + 1));
} else {
widget.shotListState.parallaxoffsetproject =
1.0 + (0.21 * (y / 2.round() + 1));
}
widget.shotListState.inputlistenable.value += 1;
});
},
),
),
Divider(
color: Colors.grey[700],
thickness: 0.3,
height: 0.5,
indent: 16
),
],
);
}),
),
),
),
],
),
),
),
);
}
}
I have tried using ‘isScrollControlled’ property, ‘DraggableScrollableSheet’, set the constraints to full screen, wrap my content in ‘LayoutBuilder’, & wrap my content in ‘MediaQuery’ but the menu has not increased to full screen. The size remains the same.