flutter调出键盘报错溢出异常:bottom overflowed by 104 PIXELS

简介: flutter调出键盘报错溢出异常:bottom overflowed by 104 PIXELS

如题,在做登录时,点击输入用户名的输入框,唤起键盘报错溢出BUG:bottom overflowed by 104 PIXELS。

报错时直接使用的Scaffold布局,在body中创建Column。出错误代码:

return new Scaffold(
      appBar: new AppBar(
        title: new Text("搜索"),
      ),
      //使用ScrollView包装一下,否则键盘弹出时会报错空间溢出
      body: new Column( ... )
            ),
          ),
 );

解决办法是使用SingleChildScrollView包装一下:

return new Scaffold(
      appBar: new AppBar(
        title: new Text("搜索"),
      ),
      //使用ScrollView包装一下,否则键盘弹出时会报错空间溢出
      body: new SingleChildScrollView(
            child: new ConstrainedBox(
              constraints: new BoxConstraints(
                minHeight: 120.0,
              ),
              child: new Column(
                mainAxisSize: MainAxisSize.min,
                mainAxisAlignment: MainAxisAlignment.spaceAround,
                children: <Widget>[
                  new Padding(
                    padding: EdgeInsets.fromLTRB(0.0, 40.0, 0.0, 10.0),
                    child:new Text("注意",style: new TextStyle(fontSize: 18.0,color: Colors.orangeAccent),),
                  ),
                ],
              ),
            ),
          ),
    );
目录
相关文章
|
5月前
Flutter-解决Try catch出现异常:type ‘_TypeError‘ is not a subtype of type ‘Exception‘ in type cast
Flutter-解决Try catch出现异常:type ‘_TypeError‘ is not a subtype of type ‘Exception‘ in type cast
103 1
|
5月前
|
缓存 Dart 开发工具
解决Flutter报错The method ‘File.create‘ has fewer named arguments than those of overridden method
解决Flutter报错The method ‘File.create‘ has fewer named arguments than those of overridden method
68 3
|
2月前
|
存储 测试技术 Shell
Flutter UT太多导致跑覆盖率报错
Flutter UT太多导致跑覆盖率报错
30 2
|
5月前
|
Dart JavaScript 前端开发
Dart或Flutter中解决异常-type ‘int‘ is not a subtype of type ‘double‘
Dart或Flutter中解决异常-type ‘int‘ is not a subtype of type ‘double‘
170 4
|
5月前
Flutter更改主题颜色报错:type ‘Color‘ is not a subtype of type ‘MaterialColor‘
Flutter更改主题颜色报错:type ‘Color‘ is not a subtype of type ‘MaterialColor‘
56 4
|
5月前
解决Flutter报错The named parameter |method ‘xxxx‘ isn‘t defined.
解决Flutter报错The named parameter |method ‘xxxx‘ isn‘t defined.
198 3
|
5月前
|
Dart
Flutter使用Scaffold报错。
Flutter使用Scaffold报错。
55 3
|
5月前
|
开发工具 iOS开发
解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app
解决Flutter运行报错Could not run build/ios/iphoneos/Runner.app
198 2
|
5月前
|
iOS开发
解决Flutter运行IOS报错:Podfile is out of date
解决Flutter运行IOS报错:Podfile is out of date
88 1
|
5月前
解决Flutter报错boxconstraints has non-normalized height/width constraints
解决Flutter报错boxconstraints has non-normalized height/width constraints
59 0