showModalBottomSheet<void>(
// context and builder are
// required properties in this widget
context: context,
builder: (BuildContext context) {
// we set up a container inside which
// we create center column and display text
// Returning SizedBox instead of a Container
return SizedBox(
height: MediaQuery.of(context).size.height * 0.6,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
Text('HERE You'll add all your content'),
],
),
),
);
},
);
3条答案
按热度按时间lstz6jyr1#
为此,您可以使用showModalBottomSheet方法,简单示例如下
你可以阅读更多关于这个方法here
fnx2tebb2#
您可以像下面一样使用showModalBottomSheet()...
您可以在中调用上述方法
屏幕或按钮onPressed或onTap的initState()。
ldfqzlk83#
根据您共享的图像,我已经尝试了类似的东西使用
ModalBottomSheet
您的按钮小工具
bottomSheet小工具:
结果屏幕-〉