【问题标题】:Mouse drag not working in listview.builder?鼠标拖动在 listview.builder 中不起作用?
【发布时间】:2021-11-10 20:12:52
【问题描述】:

我有以下代码:

ListView.builder(
            padding: EdgeInsets.zero,
            physics: globalScrollPhysics,
            scrollDirection: Axis.horizontal,
            itemCount: this.results.length,
            itemBuilder: (context, index) {
              return SearchResultCard(
                  foodData: this.results[index],
                  constraints: this.constraints,
                  index: index);
            },
          ),

globalScrollPhysics 就是 AlwaysScrollableScrollPhysics。我面临的问题是我似乎无法拖动列表视图来用鼠标滚动。我可以使用触控板并用两根手指滚动,但是当我使用鼠标时,我无法拖动它。是什么导致了这个问题?小部件位于堆栈的顶部,因此上面没有任何内容。

【问题讨论】:

    标签: flutter dart


    【解决方案1】:

    Flutter V2.5

    上移除了用鼠标拖动滚动

    更多信息,Check this git thread

    【讨论】:

    • 真的没有办法让Horizo​​ntal ListView 可以拖动吗?
    • 是的,有可能,检查on docthis question
    猜你喜欢
    • 2015-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-01
    相关资源
    最近更新 更多