Added an Index to DraggableGridItem
Hi,
I made a straightforward change to your package - I added an Index to DraggableGridItem. This change allows Shared Preferences to store the list of DraggableGridItems and sort them accordingly.
Please feel free to dismiss the pull request and bear with me if I did something wrong: it's my first pull request for a package. :) (I also had to add some properties to DragTargetGrid, these were mandatory by the compiler)
Thanks for your great package!
Michael
Sorting Example:
Future
if (prefs.getStringList('indexes') != null) { List<String> indexes = prefs.getStringList('indexes')!; draggableGridItems.sort((a, b) => indexes .indexOf(a.index.toString()) .compareTo(indexes.indexOf(b.index.toString()))); }