我有一个设计(如照片所示),并且正在使用showModalBottomSheet,但是当我设置宽度时,它不会改变并保持屏幕宽度,因此我有几个问题:
1-如何为showModalBottomSheet设置宽度
2-是否有其他替代showModalBottomSheet的底部菜单
3-如何模糊背景,就像照片中显示的那样
showModalBottomSheet<void>(
context: context,
builder: (BuildContext context) {
return Container(
height: SizeConfig.screenHeight * 0.6,
width: 30,
color: Colors.red,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
const Text('Modal BottomSheet'),
ElevatedButton(
child: const Text('Close BottomSheet'),
onPressed: () => Navigator.pop(context),
)
],
),
),
);
},
);