Android 底部图像在颤振中流动了82个像素
我得到底部溢出82像素的例外,在底部的注册屏幕。尝试使用Android 底部图像在颤振中流动了82个像素,android,flutter,android-activity,Android,Flutter,Android Activity,我得到底部溢出82像素的例外,在底部的注册屏幕。尝试使用resizeToAvoidBottomPadding:false但不起作用。我正在将颤振模块集成到现有的android应用程序中。在一个活动中调用flatter。根据屏幕高度,它是覆盖按钮或文本。有时它显示底部溢出7个像素。它根据屏幕高度而变化。 代码如下: @override Widget build(BuildContext context) { // TODO: implement build return Sc
resizeToAvoidBottomPadding:false
但不起作用。我正在将颤振模块集成到现有的android应用程序中。在一个活动中调用flatter。根据屏幕高度,它是覆盖按钮或文本。有时它显示底部溢出7个像素。它根据屏幕高度而变化。
代码如下:
@override
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
//resizeToAvoidBottomPadding : false,
key: _scaffoldKey,
body: SingleChildScrollView(
child: SafeArea(
child: Container(
height: SizeConfig.blockSizeVertical * 100,
width: SizeConfig.blockSizeHorizontal * 100,
decoration: BoxDecoration(
color: Color(0xffF44336)
),
child:Stack(
children: <Widget>[
Hero(
tag: 'signupTag',
child: Container(
height: SizeConfig.blockSizeVertical * 30,
width: SizeConfig.blockSizeHorizontal * 100,
alignment: Alignment.center,
child: Text('Sign up', style: TextStyle(fontFamily:'Montserrat', fontSize: 50.0, color: Colors.white))
),
),
Positioned(
bottom: 0.0,
child: Container(
padding: EdgeInsets.only(top:70.0, left: 50.0, right:50.0),
height: SizeConfig.blockSizeVertical * 75,
width: SizeConfig.blockSizeHorizontal * 100,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(topLeft: Radius.circular(45.0), topRight: Radius.circular(45.0))
),
child: Column(
children: <Widget>[
Container(
alignment: Alignment.centerLeft,
child:Text('Welcome', style:TextStyle(fontSize:30.0, fontWeight: FontWeight.bold, fontFamily: 'Montserrat', color: Color(0xff424242)),),
),
Container(
margin: EdgeInsets.only(bottom:20.0),
alignment: Alignment.centerLeft,
child:Text('Create an account to continue', style:TextStyle(fontSize:16.0, fontWeight: FontWeight.bold, fontFamily: 'Montserrat', color: Color(0xff707475)),),
),
TextField(
controller: nameController,
style: TextStyle(fontSize:17.0),
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 15.0),
hintText: "Full Name",
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0xffff992b), width: 2.0)
)
),
),
SizedBox(
height: 25.0,
),
TextField(
controller: emailController,
style: TextStyle(fontSize:17.0),
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 15.0),
hintText: "Email",
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0xffff992b), width: 2.0)
)
),
),
SizedBox(
height: 25.0,
),
TextField(
obscureText: true,
controller: passwordController,
style: TextStyle(fontSize:17.0),
autocorrect: false,
decoration: InputDecoration(
contentPadding: EdgeInsets.fromLTRB(0.0, 15.0, 0.0, 15.0),
hintText: "Password",
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0xffff992b), width: 2.0)
)
),
),
SizedBox(
height: 40.0,
),
Stack(
children: <Widget>[
Positioned.fill(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 20.0),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(32.0)),
boxShadow: [
BoxShadow(
offset: Offset(0.0, 15.0),
blurRadius: 15.0,
color: Color(0xffBDBDBD),
spreadRadius: 2.0
)
]
)
)
),
Material(
// elevation: 5.0,
borderRadius: BorderRadius.circular(30.0),
color: Color(0xffF44336),
child: MaterialButton(
minWidth: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(20.0),
onPressed: () {
signup().then((res){
if(res['status'] == 'Success'){
Navigator.push(
context,
MaterialPageRoute(builder: (context) => LoginPage()),
);
} else {
_displaySnackBar(context, res['comments']);
}
});
},
child: Text("CREATE",
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, fontSize:15.0, letterSpacing: 1.5),
)
),
),
],
),
SizedBox(
height: 30.0,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text("Already have an account?", style:TextStyle(fontSize: 16.0)),
Hero(
tag: 'loginTag',
child:FlatButton(
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(builder: (context) => LoginPage()),
);
},
child: Text('Sign in', style:TextStyle(fontSize: 18.0, color: Color(0xffF44336)))
)
)
],
)
],
)
),
)
],
)
)
)
)
);
}
}
@覆盖
小部件构建(构建上下文){
//TODO:实现构建
返回脚手架(
//resizeToAvoidBottomPadding:false,
钥匙:_scaffoldKey,
正文:SingleChildScrollView(
儿童:安全区(
子:容器(
高度:SizeFig.blockSizeVertical*100,
宽度:SizeFig.blockSizeHorizontal*100,
装饰:盒子装饰(
颜色:颜色(0xffF44336)
),
子:堆栈(
儿童:[
英雄(
标签:'signupTag',
子:容器(
高度:SizeFig.blockSizeVertical*30,
宽度:SizeFig.blockSizeHorizontal*100,
对齐:对齐.center,
子项:文本('注册',样式:TextStyle(fontFamily:'Montserrat',fontSize:50.0,颜色:Colors.white))
),
),
定位(
底部:0.0,
子:容器(
填充:仅限边缘设置(顶部:70.0,左侧:50.0,右侧:50.0),
高度:SizeFig.blockSizeVertical*75,
宽度:SizeFig.blockSizeHorizontal*100,
装饰:盒子装饰(
颜色:颜色,白色,
borderRadius:仅限borderRadius(左上角:半径.圆形(45.0),右上角:半径.圆形(45.0))
),
子:列(
儿童:[
容器(
对齐:alignment.centerLeft,
子项:文本('Welcome',样式:TextStyle(fontSize:30.0,fontWeight:fontWeight.bold,fontFamily:'Montserrat',颜色:颜色(0xff424242)),
),
容器(
边距:仅限边缘组(底部:20.0),
对齐:alignment.centerLeft,
子项:文本('创建帐户以继续',样式:文本样式(fontSize:16.0,fontWeight:fontWeight.bold,fontFamily:'Montserrat',颜色:颜色(0xff707475)),
),
文本字段(
控制器:名称控制器,
样式:TextStyle(字体大小:17.0),
装饰:输入装饰(
contentPadding:EdgeInsets.fromLTRB(0.0,15.0,0.0,15.0),
hintText:“全名”,
FocusedOrder:下划线输入边框(
borderSide:borderSide(颜色:颜色(0xffff992b),宽度:2.0)
)
),
),
大小盒子(
身高:25.0,
),
文本字段(
控制器:emailController,
样式:TextStyle(字体大小:17.0),
装饰:输入装饰(
contentPadding:EdgeInsets.fromLTRB(0.0,15.0,0.0,15.0),
hintText:“电子邮件”,
FocusedOrder:下划线输入边框(
borderSide:borderSide(颜色:颜色(0xffff992b),宽度:2.0)
)
),
),
大小盒子(
身高:25.0,
),
文本字段(
蒙昧文字:对,
控制器:密码控制器,
样式:TextStyle(字体大小:17.0),
自动更正:错误,
装饰:输入装饰(
contentPadding:EdgeInsets.fromLTRB(0.0,15.0,0.0,15.0),
hintText:“密码”,
FocusedOrder:下划线输入边框(
borderSide:borderSide(颜色:颜色(0xffff992b),宽度:2.0)
)
),
),
大小盒子(
身高:40.0,
),
堆叠(
儿童:[
定位填充(
子:容器(
边缘:边缘组。对称(水平:20.0),
装饰:盒子装饰(
borderRadius:borderRadius.all(半径.圆形(32.0)),
boxShadow:
body: SafeArea
- SingleChildScrollView
-Container(remove height)