Flutter设resizeToAvoidBottomInset为false仍被键盘顶起模态BottomSheet怎么办
我在开发Flutter应用时遇到了位置适配的异常:即便已将Scaffold的resizeToAvoidBottomInset属性设置为false,键盘弹出时仍会向上顶起模态BottomSheet,我希望模态BottomSheet能完全保持初始位置,不随键盘弹出发生偏移。
下面是当前用于实现模态BottomSheet的代码,同时附上演示该异常的录屏:
Scaffold( resizeToAvoidBottomInset: false, key: _scaffoldKey, body: ... ) showModalBottomSheet( context: context, isScrollControlled: true, backgroundColor: Colors.transparent, builder: (context) => Container( height: MediaQuery.of(context).size.height * 0.8, decoration: new BoxDecoration( color: Colors.white, borderRadius: new BorderRadius.only( topLeft: const Radius.circular(25.0), topRight: const Radius.circular(25.0), ), ), child: SearchPlace((place, alreadyExists) { Navigator.pop(context); didSelectPlace(place, alreadyExists); }), ), );

烦请提供可行的解决方案,感谢帮助。
内容的提问来源于stack exchange,提问作者Mircea Dragota
相关产品推荐
相关产品推荐

