如何根据儿童内容包装高度以进行showmodalbottomsheet或删除自动高度
我有一个底部表,在底部的纸上,我正在管理路由 我的每个屏幕都有不同的屏幕尺寸。我想更改每个屏幕的showmodalbottomsheet
的高度。
showModalBottomSheet<void>(
context: context,
isDismissible: true,
//isScrollControlled: true,
elevation: 2.0,
barrierColor: Colors.white.withOpacity(0),
builder: (BuildContext context) {
// double ht = Provider.of<SearchByLocationNotify>(context).getScreenSize;
return SizedBox(
height: MediaQuery.of(context).size.height * 0.5,// currently static height provided
child: PopUpHome());
},
);
- 根据每个屏幕更改高度
- 或包裹孩子的内容,以便不需要静态高度
在上面的图像中,红色porion是show> showmodalbottomsheet
blue blue是我的孩子,所以我想要红色部分只能占据蓝色。
I have one bottom sheet and under that bottom sheet i am managing routing
my each screen have different screen size. and i want to change the height of showModalBottomSheet
for each screen.
showModalBottomSheet<void>(
context: context,
isDismissible: true,
//isScrollControlled: true,
elevation: 2.0,
barrierColor: Colors.white.withOpacity(0),
builder: (BuildContext context) {
// double ht = Provider.of<SearchByLocationNotify>(context).getScreenSize;
return SizedBox(
height: MediaQuery.of(context).size.height * 0.5,// currently static height provided
child: PopUpHome());
},
);
- change the height according to each screen
- or wrap the content of children so that static height is not needed
In the above image red porion is showModalBottomSheet
blue is my child so i want red portion should only occupy blue.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
返回Mainaxissize的列:Mainaxissize.min从构建器返回,并将您的内容放在列窗口小部件中。
return a Column with mainAxisSize: MainAxisSize.min from the builder and place your content inside the Column widget.