huhuang03 / reorderable_grid_view

MIT License
46 stars 33 forks source link

Add dragStartDelay duration option to control how long until the drag… #35

Closed Milad-Akarie closed 2 years ago

Milad-Akarie commented 2 years ago

Add dragStartDelay duration option to control how long until the drag starts Add dragEnabled option to enable or disable dragging bump up version to 2.2.3-alpha.4

huhuang03 commented 2 years ago

Thank you for your commit.

After some reading, I think maybe it's better to put option dragEnabled and dragStartDelay to ReorderableGridWidgetMixin, because those option is global.

Maybe you can try like the option placeholderBuilder.

Add in ReorderableGridWidgetMixin:

mixin ReorderableGridWidgetMixin on StatefulWidget {
  Duration? get dragStartDelay;
}

And ReorderableGridStateMixin:

   Duration get dragStartDelay=> widget.dragStartDelay?? kLongPressTimeout;

And in ReorderableItemViewState can access like this:

_listState.dragStartDelay
Milad-Akarie commented 2 years ago

@huhuang03 done

huhuang03 commented 2 years ago

Thank you.