Refactor generic code in reorderable_list.dart into a base class / widget #94848
Labels
c: proposal
A detailed proposal for a change to Flutter
f: scrolling
Viewports, list views, slivers, etc.
framework
flutter/packages/flutter repository. See also f: labels.
P3
Issues that are less important to the Flutter project
team-framework
Owned by Framework team
triaged-framework
Triaged by Framework team
Use case
I was looking into implementing a sliver reorderable grid, similar to the existing
SliverReorderableList
.During my research, I found that a lot of code in the existing widget is private, but generic enough to be applicable to a
SliverReorderableGrid
(which is what I am trying to implement).The fact that this code is private makes creating my own widget a little harder.
I have to essentially copy-paste all the private code and reimplement the important parts.
Proposal
Refactor the generic code in
reorderable_list.dart
into a more generic set of base classes, i.e.SliverReorderable
,_DragItem<T extends ReorderableState>
, in a file likereorderable.dart
. The private code could still be kept private, but moved to that file.The existing
SliverReorderableList
should be refactored to use this newSliverReorderable
.This would make fixing #46430 easier, as the only thing missing is the
SliverReorderableGrid
, which would extend theSliverReorderable
.cc @darrenaustin
The text was updated successfully, but these errors were encountered: