mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-02-02 06:46:22 +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) {
|
void _transformItems(List<Person> items) {
|
||||||
_items = 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(
|
.map((e) => _PersonListItem(
|
||||||
account: widget.account,
|
account: widget.account,
|
||||||
name: e.name,
|
name: e.name,
|
||||||
|
|
Loading…
Reference in a new issue