📜  可拖动项目到达边缘时颤动滚动视图 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:33.103000             🧑  作者: Mango

代码示例1
//Works fine, although it is no very smooth
Listener(
  child: draggable,
  onPointerMove: (PointerMoveEvent event) {
    if (event.position.dy > MediaQuery.of(context).size.height - 100) {
      // 120 is height of your draggable.
      scrollController.scrollTo(scrollcontroller.offset + 120);
    }
  },
);