格式化代码
All checks were successful
Dart CI / build (push) Successful in 31s

This commit is contained in:
2026-04-05 19:46:02 +08:00
parent 2bb8a83bbc
commit a0bc231c3c
2 changed files with 43 additions and 35 deletions

View File

@@ -13,7 +13,6 @@ class PhotoRepository {
PhotoRepository(this.basePath);
/// 获取相册中的照片(分页)
Future<PageResult<Photo>> getPhotosByAlbumIdPaged(
int id, {
@@ -93,10 +92,7 @@ class PhotoRepository {
}
/// 创建排序比较器
int Function(Photo, Photo) _createComparator(
String sortBy,
String order,
) {
int Function(Photo, Photo) _createComparator(String sortBy, String order) {
final ascending = order == 'asc';
int compare(Photo a, Photo b) {
@@ -105,9 +101,7 @@ class PhotoRepository {
if (valueA == null && valueB == null) return 0;
if (valueA == null) return 1;
if (valueB == null) return -1;
return ascending
? valueA.compareTo(valueB)
: valueB.compareTo(valueA);
return ascending ? valueA.compareTo(valueB) : valueB.compareTo(valueA);
}
switch (sortBy) {