knaeckeKami / diffutil_sliverlist

Apache License 2.0
23 stars 2 forks source link

Implementation of move is missing #4

Open proformance opened 3 years ago

proformance commented 3 years ago

Hi!

Great work with this package! I have a question regarding the missing move-implementation, is there a reason for this? It seems to be supported in diff_util?

void _onDiffUpdate(diffutil.DiffUpdate update) {
  update.when<void>(
      move: (_, __) =>
          throw UnimplementedError('moves are currently not supported'),
      insert: _onInserted,
      change: _onChanged,
      remove: _onRemoved);
}

Best regards

knaeckeKami commented 3 years ago

The reason is that this package is just small glue code between diffutil_dart and SliverAnimatedList. diffutil_dart supports move detection, but SliverAnimatedList does not support animating moves.

So I disable move detection (see https://github.com/knaeckeKami/diffutil_sliverlist/blob/master/lib/src/diffutil_sliverlist_widget.dart#L108 ), so the move: parameter should never be called.