android – 在颤动时底部超载213像素

前端之家收集整理的这篇文章主要介绍了android – 在颤动时底部超载213像素前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
嗨,我正在尝试创建登录屏幕.它对我来说很好.当我打开键盘然后它给我一个错误底部重载213像素.

Widget LoginPage() {
    return new Scaffold(body: Container(
      height: MediaQuery.of(context).size.height,decoration: BoxDecoration(
        color: Colors.white,image: DecorationImage(
          colorFilter: new ColorFilter.mode(
              Colors.black.withOpacity(0.05),BlendMode.dstATop),image: AssetImage('assets/images/mountains.jpg'),fit: BoxFit.cover,),child: new Column(
        children: <Widget>[
          Container(
            padding: EdgeInsets.all(120.0),child: Center(
              child: Icon(
                Icons.headset_mic,color: Colors.redAccent,size: 50.0,new Row(
            children: <Widget>[
              new Expanded(
                child: new Padding(
                  padding: const EdgeInsets.only(left: 40.0),child: new Text(
                    "EMAIL",style: TextStyle(
                      fontWeight: FontWeight.bold,fontSize: 15.0,],new Container(
            width: MediaQuery.of(context).size.width,margin: const EdgeInsets.only(left: 40.0,right: 40.0,top: 10.0),alignment: Alignment.center,decoration: BoxDecoration(
              border: Border(
                bottom: BorderSide(
                    color: Colors.redAccent,width: 0.5,style: BorderStyle.solid),padding: const EdgeInsets.only(left: 0.0,right: 10.0),child: new Row(
              crossAxisAlignment: CrossAxisAlignment.center,mainAxisAlignment: MainAxisAlignment.start,children: <Widget>[
                new Expanded(
                  child: TextField(
                    obscureText: true,textAlign: TextAlign.left,decoration: InputDecoration(
                      border: InputBorder.none,hintText: 'samarthagarwal@live.com',hintStyle: TextStyle(color: Colors.grey),Divider(
            height: 24.0,child: new Text(
                    "PASSWORD",hintText: '*********',new Row(
            mainAxisAlignment: MainAxisAlignment.end,children: <Widget>[
              Padding(
                padding: const EdgeInsets.only(right: 20.0),child: new FlatButton(
                  child: new Text(
                    "Forgot Password?",textAlign: TextAlign.end,onPressed: () => {},margin: const EdgeInsets.only(left: 30.0,right: 30.0,top: 20.0),child: new Row(
              children: <Widget>[
                new Expanded(
                  child: new FlatButton(
                    shape: new RoundedRectangleBorder(
                      borderRadius: new BorderRadius.circular(30.0),child: new Container(
                      padding: const EdgeInsets.symmetric(
                        vertical: 20.0,horizontal: 20.0,child: new Row(
                        mainAxisAlignment: MainAxisAlignment.center,children: <Widget>[
                          new Expanded(
                            child: Text(
                              "LOGIN",textAlign: TextAlign.center,style: TextStyle(
                                  color: Colors.white,fontWeight: FontWeight.bold),child: Row(
              children: <Widget>[
                new Expanded(
                  child: new Container(
                    margin: EdgeInsets.all(8.0),decoration: BoxDecoration(border: Border.all(width: 0.25)),Text(
                  "OR CONNECT WITH",style: TextStyle(
                    color: Colors.grey,fontWeight: FontWeight.bold,new Expanded(
                  child: new Container(
                    margin: EdgeInsets.all(8.0),child: new Row(
              children: <Widget>[
                new Expanded(
                  child: new Container(
                    margin: EdgeInsets.only(right: 8.0),child: new Row(
                      children: <Widget>[
                        new Expanded(
                          child: new FlatButton(
                            shape: new RoundedRectangleBorder(
                              borderRadius: new BorderRadius.circular(30.0),color: Color(0Xff3B5998),child: new Container(
                              child: new Row(
                                mainAxisAlignment: MainAxisAlignment.center,children: <Widget>[
                                  new Expanded(
                                    child: new FlatButton(
                                      padding: EdgeInsets.only(
                                        top: 20.0,bottom: 20.0,child: new Row(
                                        mainAxisAlignment:
                                        MainAxisAlignment.spaceEvenly,children: <Widget>[
                                          Icon(
                                            const IconData(0xea90,fontFamily: 'icomoon'),color: Colors.white,size: 15.0,Text(
                                            "FACEBOOK",style: TextStyle(
                                                color: Colors.white,new Expanded(
                  child: new Container(
                    margin: EdgeInsets.only(left: 8.0),color: Color(0Xffdb3236),children: <Widget>[
                                          Icon(
                                            const IconData(0xea88,Text(
                                            "GOOGLE",)
        ],));
  }

有谁知道可能是什么问题?

enter image description here

解决方法

您通常需要在窗口小部件上提供滚动窗口小部件,因为如果您尝试打开键盘或更改手机的方向,则颤动需要知道如何处理窗口小部件的分布.

请查看此资源,您可以检查flutter提供的不同选项开箱即用,并为您的方案选择最佳选项.

https://flutter.io/widgets/scrolling/

猜你在找的Flutter相关文章