android – 在颤动时底部超载213像素
发布时间:2020-12-14 14:49:17 所属栏目:百科 来源:网络整理
导读:嗨,我正在尝试创建登录屏幕.它对我来说很好.当我打开键盘然后它给我一个错误底部重载213像素. Widget LoginPage() { return new Scaffold(body: Container( height: MediaQuery.of(context).size.height,decoration: BoxDecoration( color: Colors.white,ima
嗨,我正在尝试创建登录屏幕.它对我来说很好.当我打开键盘然后它给我一个错误底部重载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",) ],)); } 有谁知道可能是什么问题? 解决方法
您通常需要在窗口小部件上提供滚动窗口小部件,因为如果您尝试打开键盘或更改手机的方向,则颤动需要知道如何处理窗口小部件的分布.
请查看此资源,您可以检查flutter提供的不同选项开箱即用,并为您的方案选择最佳选项. https://flutter.io/widgets/scrolling/ (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |