【发布时间】:2018-06-12 13:31:20
【问题描述】:
我的应用中有以下抽屉:
当我按下密码TextFormField 时,我得到以下信息:
如您所见,密码TextFormField 已被覆盖。按照here的建议,我试图解决这个问题:
class _LoginDrawer extends State<LoginDrawer> {
static var _listViewScrollController = new ScrollController();
@override
Widget build(BuildContext context) => new Drawer(
child: new ListView(
controller: _listViewScrollController,
children: <Widget>[
// ...
new Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: new GestureDetector(
onTap: () {
SchedulerBinding.instance.addPostFrameCallback((_) {
_listViewScrollController.jumpTo(
_listViewScrollController.position.maxScrollExtent);
});
},
child: new TextFormField(
obscureText: true,
decoration: new InputDecoration(labelText: "Password")),
),
),
],
),
);
}
但这并不能解决问题,该应用程序的行为与以前相同。还有一些人建议使用反转的ListView,然后使用listViewController.jumpTo(0.0),但这会导致不良效果,即所有小部件都从底部开始:
【问题讨论】:
-
这是颤振的问题,检查这是否与您的情况有关stackoverflow.com/questions/46841637/…
-
这个问题应该被修复(至少在
master) -
你有解决办法吗?
-
Na bruh,这就像一百万年前,我什至不再开发这个应用程序了,skrrr。
标签: flutter