Add flag to use adjusted value for newIndex in onReorder callback for ReorderableList widgets#93146
Add flag to use adjusted value for newIndex in onReorder callback for ReorderableList widgets#93146markusaksli-nc wants to merge 2 commits intoflutter:masterfrom
Conversation
… ReorderableList widgets
|
I haven't done the guide yet, first just let me know if I'm starting this off right since it's my first breaking change. |
|
@markusaksli-nc - the 3 1/2 year old issue that this PR would fix is embarrassing for both its age and the triviality of the obvious remedy. The original widget (#18374) had a long gestation period and the onReorder callback problem (#24786) which was reported about 3 months later, was not dealt with promptly. The approach you've suggested here, allowing developers to opt-in to the fix, does make sense, but we don't have a way to automatically update code (via FlutterFix) that works around the problem per the original documentation. That means that we'd have to continue to support the opt-in flag forever, which - IMHO - complicates everything just a little more than the fix is worth. There are other ways to handle this, e.g. we could add an additional callback, but having two almost identical callbacks doesn't seem like an overall improvement either. Note also: I apologize for taking so long to review this. |
|
I had this concern back when I looked at this issue (although I didn't think it was that hopeless). At this point is there even a viable way to get this fix in? Nothing comes to mind right away other than the flag (which seems pointless without migration) or another callback. |
|
It's a shame, but I think - at this point in time - it's best to leave this issue as it is. |
|
Personally I think this is like saying that because we accidentally reversed 1 and 0, from henceforth the number line shall be 1, 0, 2, 3, 4, 5, 6, 7, 8, 9. It's a VERY common use item, so it should be corrected for the future of Flutter, which will be much longer than its past, right? I hope? Do you not expect BETTER things to come? How about advancing the language version just for this, since it's so freaking common a function? Bump it to 2.5, BREAKING, like was done to 2.0. Why is that a problem? Fix this for the future, don't hobble it for the past. |
|
official crutches.... |
Adds an opt-in flag to use the adjusted value for the
newIndexinonReorderforReorderableListViewand the underlyingSliverReorderableList. Starting off with opt-in since this will be a breaking change (see #59103)From gallery
reorderable_list_demo.dart:Starts off the breaking change to fix #24786
Pre-launch Checklist
///).