【问题标题】:Scrolling Widget inside a Constant size Container flutter web在恒定大小的容器中滚动小部件颤动网络
【发布时间】:2020-11-11 01:28:35
【问题描述】:

各位开发者大家好,

我正在使用 Flutter Web SDK 在 Flutter 中开发响应式网页,但我被困在页面的一个部分,其中我有一个 Row inside row 我有 2 个容器,其中我希望第一个容器是可滚动的并且第二个容器具有恒定大小(不可滚动),就像whatsapp web ui一样,其中联系人列表不断滚动,但聊天端和页面的其余部分没有。

请帮助我, 提前谢谢...

【问题讨论】:

    标签: flutter responsive-design progressive-web-apps flutter-web


    【解决方案1】:

    这应该可以工作您需要一个固定大小的容器,并确保其中应该有一个可滚动的小部件。现在可以通过使用媒体查询参数和下面的代码来调整大小,您只需要调整空间和大小就可以了。

    Row(
                  //Your parent Row
                  children: [
                    Container(
                      //static non scrollable container
                      child: Column(
                        children: [
                          //Children you want to add 
                          //this wont be scrollable 
                          //It is also preferred that you give this some height or width too
                        ],
                      ),
                    ),
                    Container(
                      //Scrollable container
                      //Please adjust height and width yourself 
                      //You can use media query parameters to make it responsive
                      width: 200,
                      height: 500,
                      child: SingleChildScrollView(
                        //You can also change the scroll direction
                        child: Column(
                          //Add children you want to be in
                          //Scrollable column
                          
                        ),
                      ),
                    )
                  ],
                ),
    

    【讨论】:

    • 如果有帮助,请接受答案,以便其他人知道这对他们有益。
    猜你喜欢
    • 2019-05-23
    • 2020-08-02
    • 2021-09-07
    • 2020-11-29
    • 2020-10-14
    • 2021-07-28
    • 1970-01-01
    • 1970-01-01
    • 2020-09-20
    相关资源
    最近更新 更多