Flutter 颤振布局错误';底部无限像素溢出的RenderFlex';
我有脚手架和Flutter 颤振布局错误';底部无限像素溢出的RenderFlex';,flutter,Flutter,我有脚手架和 MaterialApp( home: Scaffold( body: Stact( .... .... return Column( children: <Widget>[ Align( alignment: Alignment.topCenter, child: Padding(
MaterialApp(
home: Scaffold(
body: Stact(
....
....
return Column(
children: <Widget>[
Align(
alignment: Alignment.topCenter,
child: Padding(
padding: EdgeInsets.fromLTRB(0.0, 60.0, 0.0, 0.0),
child: Image(
image: AssetImage('assets/images/logo.png'),
),
),
),
authController.signIn() == true ? SignInView() : SignUpView(),
Align(
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.fromLTRB(0.0, 0.0, 0.0, 35.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
RaisedButton(
child: Text('Sign In',
style: TextStyle(
color: Colors.white,
)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(15.0),
topLeft: Radius.circular(15.0),
),
side: BorderSide(color: Colors.orange)),
color: Colors.transparent,
onPressed: () {
print('login');
authController.toSignIn(true);
},
),
RaisedButton(
child: Text('Sign Up',
style: TextStyle(
color: Colors.white,
)),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomRight: Radius.circular(15.0),
topRight: Radius.circular(15.0),
),
side: BorderSide(color: Colors.orange)),
color: Colors.transparent,
onPressed: () {
print('signup');
authController.toSignIn(false);
},
),
],
),
),
)
],
);
MaterialApp(
家:脚手架(
正文:Stact(
....
....
返回列(
儿童:[
对齐(
对齐:alignment.topCenter,
孩子:填充(
填充:从LTRB(0.0,60.0,0.0,0.0)开始的边缘设置,
孩子:图像(
图像:AssetImage('assets/images/logo.png'),
),
),
),
authController.signIn()==true?SignInView():SignUpView(),
对齐(
对齐:对齐.center,
孩子:填充(
填充:LTRB(0.0,0.0,0.0,35.0)中的常数边集,
孩子:排(
mainAxisAlignment:mainAxisAlignment.center,
儿童:[
升起的按钮(
子项:文本('登录',
样式:TextStyle(
颜色:颜色,白色,
)),
形状:圆形矩形边框(
borderRadius:仅限borderRadius(
左下角:半径。圆形(15.0),
左上:半径。圆形(15.0),
),
边:边框边(颜色:Colors.orange)),
颜色:颜色。透明,
已按下:(){
打印(“登录”);
authController.toSignIn(true);
},
),
升起的按钮(
子项:文本('注册',
样式:TextStyle(
颜色:颜色,白色,
)),
形状:圆形矩形边框(
borderRadius:仅限borderRadius(
右下角:半径。圆形(15.0),
右上角:半径。圆形(15.0),
),
边:边框边(颜色:Colors.orange)),
颜色:颜色。透明,
已按下:(){
打印(“注册”);
authController.toSignIn(false);
},
),
],
),
),
)
],
);
使用
返回脚手架(
背景颜色:颜色。透明,
主体:容器(
高度:100.0,
子:列(
儿童:[
Text('hey'),
],
),
),
);
一旦我在列Children
中添加SignenView和SignOutView,我就会收到底部无限像素溢出的RenderFlex
我尝试将脚手架更改为其他类型,容器,甚至使用填充小部件。如何将脚手架高度100%设置为其父级的高度,如CSS高度100vh或颤振中的其他类型?您不应在另一个脚手架内使用脚手架。从SignenView()中移除脚手架并将其保留为容器
return Container(
height: 100.0,
child: Column(
children: <Widget>[
Text('hey'),
],
),
),
返回容器(
高度:100.0,
子:列(
儿童:[
Text('hey'),
],
),
),
请让我知道这是否有帮助。干杯
return Container(
height: 100.0,
child: Column(
children: <Widget>[
Text('hey'),
],
),
),