Flutter 颤振滚动视图

Flutter 颤振滚动视图,flutter,web,flutter-layout,flutter-web,Flutter,Web,Flutter Layout,Flutter Web,我在使web应用程序的一部分可滚动时遇到问题。我尝试了多种解决方案,但都没有效果。有什么想法吗 Flexible( flex: 3, child: Align( alignment: Alignment.topRight, child: Padding( padding: const EdgeInsets.fromLTRB(20, 20, 0, 0),

我在使web应用程序的一部分可滚动时遇到问题。我尝试了多种解决方案,但都没有效果。有什么想法吗

Flexible(
          flex: 3,
          child: Align(
            alignment: Alignment.topRight,
            child: Padding(
              padding: const EdgeInsets.fromLTRB(20, 20, 0, 0),
              child: Column(
                children: [
                  Align(
                    alignment: Alignment.topLeft,
                    child: Text(
                        'Stories',
                        style: TextStyle(
                            color: Palette.white,
                            fontWeight: FontWeight.bold,
                            fontSize: 16
                        )
                    ),
                  ),
                  Stories(
                    currentUser: currentUser,
                    stories: stories,
                  ),
                  Padding(
                    padding: const EdgeInsets.fromLTRB(0, 20, 0, 20),
                    child: RecommendedCards(),
                  ),
                  Expanded(
                    child: Align(
                      alignment: Alignment.centerLeft,
                      child: RecommendedFollowingList(
                          users: recommendedFollow
                      ),
                    )
                  ),
                  PolicyView()
                ],
              ),
            ),
          ),
        ),
这是我的代码,我很难使其可滚动。当我尝试添加SingleChildScrollView时,我不断收到一个错误。这是这样说的

在此RenderBox上调用了hitTest()方法:_RenderScrollSemantics#0e2ee relayoutBoundary=up10: 需要合成 创建者:_ScrollSemantics-[GlobalKey#1a713]← 可滚动← 主滚动控制器← SingleChildScrollView← 排列← 灵活的← 一行← 桌面屏幕← 布局生成器← 反应敏捷的← _健美运动员← MediaQuery← ⋯ parentData:offset=offset(0.0,0.0)(可以使用大小)
约束:BoxConstraints(0.0您可以使用`包装小部件

可以滚动单个小部件的框


您可以使用`包装小部件

可以滚动单个小部件的框


它非常简单,使用SingleChildScrollview包装您的主小部件

SingleChildScrollView(
child: Padding(
                  padding: const EdgeInsets.fromLTRB(20, 20, 0, 0),
                  child: Column(
                    children: [
                      Align(
                        alignment: Alignment.topLeft,
                        child: Text(
                            'Stories',
                            style: TextStyle(
                                color: Palette.white,
                                fontWeight: FontWeight.bold,
                                fontSize: 16
                            )
                        ),
                      ),
                      Stories(
                        currentUser: currentUser,
                        stories: stories,
                      ),
                      Padding(
                        padding: const EdgeInsets.fromLTRB(0, 20, 0, 20),
                        child: RecommendedCards(),
                      ),
                      Expanded(
                        child: Align(
                          alignment: Alignment.centerLeft,
                          child: RecommendedFollowingList(
                              users: recommendedFollow
                          ),
                        )
                      ),
                      PolicyView()
                    ],
                  ),
                ),
              )

它非常简单,使用SingleChildScrollview包装您的主小部件

SingleChildScrollView(
child: Padding(
                  padding: const EdgeInsets.fromLTRB(20, 20, 0, 0),
                  child: Column(
                    children: [
                      Align(
                        alignment: Alignment.topLeft,
                        child: Text(
                            'Stories',
                            style: TextStyle(
                                color: Palette.white,
                                fontWeight: FontWeight.bold,
                                fontSize: 16
                            )
                        ),
                      ),
                      Stories(
                        currentUser: currentUser,
                        stories: stories,
                      ),
                      Padding(
                        padding: const EdgeInsets.fromLTRB(0, 20, 0, 20),
                        child: RecommendedCards(),
                      ),
                      Expanded(
                        child: Align(
                          alignment: Alignment.centerLeft,
                          child: RecommendedFollowingList(
                              users: recommendedFollow
                          ),
                        )
                      ),
                      PolicyView()
                    ],
                  ),
                ),
              )

我收到一个错误。
[error:flatter/lib/ui/ui\u dart\u state.cc(177)]未经处理的异常:无法测试没有大小的渲染框。
我还更新了帖子,以便更好地了解我遇到的问题。我收到一个错误。
[error:flatter/lib/ui/ui\u dart\u state.cc(177)]未处理的异常:无法点击测试没有大小的渲染框。
我还更新了帖子,以更好地了解我遇到的问题我还更新了帖子,以更好地了解我遇到的问题我还更新了帖子,以更好地了解我遇到的问题