2.10.2 fixes reorderlist deprecation

This commit is contained in:
stopflock
2026-06-14 18:51:10 -05:00
parent 036ac8c5e6
commit 41479e7ee4
9 changed files with 70 additions and 15 deletions
@@ -38,7 +38,7 @@ class NodeProfilesSection extends StatelessWidget {
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: appState.profiles.length,
onReorder: (oldIndex, newIndex) {
onReorderItem: (oldIndex, newIndex) {
appState.reorderProfiles(oldIndex, newIndex);
},
itemBuilder: (context, index) {
@@ -58,7 +58,7 @@ class OperatorProfilesSection extends StatelessWidget {
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
itemCount: appState.operatorProfiles.length,
onReorder: (oldIndex, newIndex) {
onReorderItem: (oldIndex, newIndex) {
appState.reorderOperatorProfiles(oldIndex, newIndex);
},
itemBuilder: (context, index) {
+1 -4
View File
@@ -47,10 +47,7 @@ class OperatorProfileState extends ChangeNotifier {
void reorderProfiles(int oldIndex, int newIndex) {
final orderedProfiles = _getOrderedProfiles();
// Standard Flutter reordering logic
if (oldIndex < newIndex) {
newIndex -= 1;
}
// With onReorderItem callback, newIndex is already adjusted
final item = orderedProfiles.removeAt(oldIndex);
orderedProfiles.insert(newIndex, item);
+1 -4
View File
@@ -129,10 +129,7 @@ class ProfileState extends ChangeNotifier {
void reorderProfiles(int oldIndex, int newIndex) {
final orderedProfiles = _getOrderedProfiles();
// Standard Flutter reordering logic
if (oldIndex < newIndex) {
newIndex -= 1;
}
// With onReorderItem callback, newIndex is already adjusted
final item = orderedProfiles.removeAt(oldIndex);
orderedProfiles.insert(newIndex, item);