3
3
// in the LICENSE file.
4
4
5
5
import 'dart:async' ;
6
+ import 'dart:io' ;
6
7
import 'dart:math' as math;
7
8
import 'dart:typed_data' ;
8
9
@@ -333,14 +334,10 @@ class DefaultAssetPickerProvider
333
334
bool onlyAll = false ,
334
335
bool keepPreviousCount = false ,
335
336
}) async {
336
- final PMFilter options;
337
+ final PMFilter ? options;
337
338
final fog = filterOptions;
338
- if (fog == null ) {
339
- options = AdvancedCustomFilter (
340
- orderBy: [OrderByItem .desc (CustomColumns .base .createDate)],
341
- );
342
- } else if (fog is FilterOptionGroup ) {
343
- final newOptions = FilterOptionGroup (
339
+ if (fog is FilterOptionGroup ) {
340
+ options = FilterOptionGroup (
344
341
imageOption: const FilterOption (
345
342
sizeConstraint: SizeConstraint (ignoreSize: true ),
346
343
),
@@ -352,9 +349,11 @@ class DefaultAssetPickerProvider
352
349
containsPathModified: sortPathsByModifiedDate,
353
350
createTimeCond: DateTimeCond .def ().copyWith (ignore: true ),
354
351
updateTimeCond: DateTimeCond .def ().copyWith (ignore: true ),
352
+ )..merge (fog);
353
+ } else if (fog == null && Platform .isAndroid) {
354
+ options = AdvancedCustomFilter (
355
+ orderBy: [OrderByItem .desc (CustomColumns .android.dateTaken)],
355
356
);
356
- newOptions.merge (fog);
357
- options = newOptions;
358
357
} else {
359
358
options = fog;
360
359
}
0 commit comments