huhuang03/reorderable_grid_view

Feature request: callback `onDropIndexChange `

Opened this issue · 2 comments

It would be great to implement a callback when the user sees the animation of the grid rebuilding:

ReorderableGridView.count(
  onDragStart: (int dragIndex) {
    HapticFeedback.selectionClick();
  },
  onDropIndexChange(int dropIndex) {
    // In my case I want to play HapticFeedback
    // every time an animation occurs
  },
);

Hello, you can try 2.2.9-alpha.4, which add

/// every an drop index changed
/// if old == null, means drag start
typedef OnDropIndexChange = void Function(int index, int? old);

Thank you very much, looking forward to the release