我有脚手架和
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);
},
),
],
),
),
)
],
);SignInView(),带有
return Scaffold(
backgroundColor: Colors.transparent,
body: Container(
height: 100.0,
child: Column(
children: <Widget>[
Text('hey'),
],
),
),
);一旦我在Column Children中添加了SignInView和SignOutView,我就会收到这个A RenderFlex overflowed by Infinity pixels on the bottom。
我曾尝试将Scaffold更改为其他东西,Container,甚至使用Padding。如何将Scaffold height设置为其父级的高度100%,就像CSS height 100vh或Flutter中的其他东西一样?
发布于 2020-11-30 23:09:26
你不应该在另一个脚手架中使用脚手架。从SignInView()中移除脚手架,并将其保留为容器
return Container(
height: 100.0,
child: Column(
children: <Widget>[
Text('hey'),
],
),
),如果这有帮助,请让我知道。干杯
https://stackoverflow.com/questions/65075776
复制相似问题