fix: Sorting of items in option dialog

fix: Translation of sizes
This commit is contained in:
PartyDonut 2025-02-07 16:56:50 +01:00
parent 2a5e2b4be1
commit 11189455ed
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,5 @@
import 'dart:collection';
import 'package:flutter/material.dart';
Future<List<T>> openMultiSelectOptions<T>(
@ -40,6 +42,10 @@ Future<List<T>> openMultiSelectOptions<T>(
currentSelection = {item};
}
});
currentSelection = SplayTreeSet.of(
currentSelection,
(a, b) => items.indexOf(a).compareTo(items.indexOf(b)),
);
onChanged?.call(currentSelection.toList());
},
);