Sort people browser by number of photos

This commit is contained in:
Ming Ming 2022-08-29 00:13:52 +08:00
parent cb285722b1
commit febfb5e557

View file

@ -161,7 +161,14 @@ class _PeopleBrowserState extends State<PeopleBrowser> {
void _transformItems(List<Person> items) {
_items = items
.sorted((a, b) => a.name.compareTo(b.name))
.sorted((a, b) {
final countCompare = b.count.compareTo(a.count);
if (countCompare == 0) {
return a.name.compareTo(b.name);
} else {
return countCompare;
}
})
.map((e) => _PersonListItem(
account: widget.account,
name: e.name,