在扑1.7.X和以后 更多的功能已经被添加到
BottomSheetDialog这样除了@
anmol.majhail的回答,您可以添加
isScrollControlled =true到
showModalBottomSheet它会允许底片取足所需的高度给出了更多的保险
TextField是不包括在键盘。
像这样:
showModalBottomSheet( shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical(top: Radius.circular(25.0))), backgroundColor: Colors.black, context: context, isScrollControlled: true, builder: (context) => Padding( padding: const EdgeInsets.symmetric(horizontal:18 ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: <Widget>[ Padding( padding: const EdgeInsets.symmetric(horizontal: 12.0), child: Text('Enter your address', style: TextStyles.textBody2), ), SizedBox( height: 8.0, ), Padding( padding: EdgeInsets.only( bottom: MediaQuery.of(context).viewInsets.bottom), child: TextField( decoration: InputDecoration( hintText: 'adddrss' ), autofocus: true, controller: _newMedialinkAddressController, ), ), SizedBox(height: 10), ], ), ));请注意:
shape: RoundedRectangleBorder( borderRadius: BorderRadius.vertical(top: Radius.circular(25.0))),
不是必需的 只是我正在创建一个圆形的底页。
更新资料
如果你的
BottomSheetModel就是
Column确保你添加
mainAxisSize:MainAxisSize.min,,否则这个表将覆盖整个屏幕。



