mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-06-30 10:05:34 +02:00
2.10.2 fixes reorderlist deprecation
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user