From 02e73eed1bd56415d6945efa7a7fb3de30bebfa7 Mon Sep 17 00:00:00 2001 From: lukas-heiligenbrunner Date: Wed, 2 Nov 2022 00:05:07 +0100 Subject: [PATCH] sort items in dialogs --- lib/dialog/add_actor_dialog.dart | 1 + lib/dialog/add_tag_dialog.dart | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/dialog/add_actor_dialog.dart b/lib/dialog/add_actor_dialog.dart index ee1df58..4a12d0e 100644 --- a/lib/dialog/add_actor_dialog.dart +++ b/lib/dialog/add_actor_dialog.dart @@ -32,6 +32,7 @@ class _AddActorDialogState extends State { return Text("Error"); } else if (snapshot.hasData) { final data = snapshot.data! as List; + data.sort((a, b) => a.name.compareTo(b.name)); return Column( mainAxisSize: MainAxisSize.min, children: data diff --git a/lib/dialog/add_tag_dialog.dart b/lib/dialog/add_tag_dialog.dart index 8cd4f6b..3990329 100644 --- a/lib/dialog/add_tag_dialog.dart +++ b/lib/dialog/add_tag_dialog.dart @@ -32,6 +32,9 @@ class _AddTagDialogState extends State { return Text("Error"); } else if (snapshot.hasData) { final data = snapshot.data! as List; + data.sort( + (a, b) => a.tagName.compareTo(b.tagName), + ); return Column( mainAxisSize: MainAxisSize.min, children: data