This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user