mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
Sort people browser by number of photos
This commit is contained in:
parent
cb285722b1
commit
febfb5e557
1 changed files with 8 additions and 1 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue