Skip to content

Commit

Permalink
🚸 Improves the default sort conditions (#662)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 authored Nov 21, 2024
1 parent 2d51c42 commit 29c2b8a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ that can be found in the LICENSE file. -->
## Unreleased

**None.**
### Improvements

- Improves the default sort conditions.

## 9.4.0

Expand Down
17 changes: 8 additions & 9 deletions lib/src/provider/asset_picker_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// in the LICENSE file.

import 'dart:async';
import 'dart:io';
import 'dart:math' as math;
import 'dart:typed_data';

Expand Down Expand Up @@ -333,14 +334,10 @@ class DefaultAssetPickerProvider
bool onlyAll = false,
bool keepPreviousCount = false,
}) async {
final PMFilter options;
final PMFilter? options;
final fog = filterOptions;
if (fog == null) {
options = AdvancedCustomFilter(
orderBy: [OrderByItem.desc(CustomColumns.base.createDate)],
);
} else if (fog is FilterOptionGroup) {
final newOptions = FilterOptionGroup(
if (fog is FilterOptionGroup) {
options = FilterOptionGroup(
imageOption: const FilterOption(
sizeConstraint: SizeConstraint(ignoreSize: true),
),
Expand All @@ -352,9 +349,11 @@ class DefaultAssetPickerProvider
containsPathModified: sortPathsByModifiedDate,
createTimeCond: DateTimeCond.def().copyWith(ignore: true),
updateTimeCond: DateTimeCond.def().copyWith(ignore: true),
)..merge(fog);
} else if (fog == null && Platform.isAndroid) {
options = AdvancedCustomFilter(
orderBy: [OrderByItem.desc(CustomColumns.android.dateTaken)],
);
newOptions.merge(fog);
options = newOptions;
} else {
options = fog;
}
Expand Down

0 comments on commit 29c2b8a

Please sign in to comment.