首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >颤动布局错误'A RenderFlex overflowed by Infinity pixels on the bottom‘

颤动布局错误'A RenderFlex overflowed by Infinity pixels on the bottom‘
EN

Stack Overflow用户
提问于 2020-11-30 22:50:32
回答 1查看 90关注 0票数 1

我有脚手架和

代码语言:javascript
复制
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(),带有

代码语言:javascript
复制
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中的其他东西一样?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-30 23:09:26

你不应该在另一个脚手架中使用脚手架。从SignInView()中移除脚手架,并将其保留为容器

代码语言:javascript
复制
return Container(
            height: 100.0,
            child: Column(
              children: <Widget>[
                Text('hey'),
              ],
            ),
          ),

如果这有帮助,请让我知道。干杯

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65075776

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档