sort items in dialogs

This commit is contained in:
lukas-heiligenbrunner 2022-11-02 00:05:07 +01:00
parent 9ef317f0ba
commit 02e73eed1b
2 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,7 @@ class _AddActorDialogState extends State<AddActorDialog> {
return Text("Error");
} else if (snapshot.hasData) {
final data = snapshot.data! as List<Actor>;
data.sort((a, b) => a.name.compareTo(b.name));
return Column(
mainAxisSize: MainAxisSize.min,
children: data

View File

@ -32,6 +32,9 @@ class _AddTagDialogState extends State<AddTagDialog> {
return Text("Error");
} else if (snapshot.hasData) {
final data = snapshot.data! as List<Tag>;
data.sort(
(a, b) => a.tagName.compareTo(b.tagName),
);
return Column(
mainAxisSize: MainAxisSize.min,
children: data