【问题标题】:Scroll down flutter modal bottomsheet with a scrollview in the sheet使用工作表中的滚动视图向下滚动颤动模式底部表
【发布时间】:2020-11-09 11:49:27
【问题描述】:

我使用flutter函数showmodalbottomsheet来显示一个带有customscroll视图的页面。

但是当滚动视图的滚动过度滚动时出现问题我想滚动底部而不是过度滚动customscrollview。

如何选择要使用的卷轴?

比如我想做点赞的Facebook评论页面:

【问题讨论】:

    标签: flutter flutter-showmodalbottomsheet


    【解决方案1】:

    你可能需要的是DraggableScrollableSheet

    showModalBottomSheet(
      isScrollControlled: true,
      context: context,
      builder: (context) => DraggableScrollableSheet(
        builder: (context, scrollController) => SingleChildScrollView(
          controller: scrollController,
          child: Column(
            children: [
              Container(
                color: Colors.purple,
                height: 100,
              ),
              Container(
                color: Colors.orange,
                height: 300,
              ),
              Container(
                color: Colors.black,
                height: 300,
              ),
            ],
          ),
        ),
      ),
    ),
    

    (当我偶然发现你的问题时,我也在寻找答案,决定分享我的研究结果:) 希望它对你有帮助!)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-13
      • 2020-08-09
      • 2019-03-19
      • 1970-01-01
      • 1970-01-01
      • 2016-12-27
      相关资源
      最近更新 更多