答案 0 :(得分:0)
使用对话框小部件。然后用它包装一个无状态或有状态的小部件。使用异步功能暂停控制,使对话框无模式
Future<bool> _onMyDialog() async {
return await showDialog<bool>(
context: context,
builder: (context) {
return Dialog(child: YourCustomStatelessWidget());
});
}
YourCustomStatelessWidget
@override
Widget build(BuildContext context) {
return Dialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
elevation: 0.0,
child: Scrollbar(
isAlwaysShown: true,
controller: _scrollController,
child: SingleChildScrollView(
controller: _scrollController,
child: Form(
key: _formKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: WidgetList)))));
}