33// in the LICENSE file.
44
55import 'dart:async' ;
6+ import 'dart:io' ;
67import 'dart:math' as math;
78import 'dart:typed_data' ;
89
@@ -333,14 +334,10 @@ class DefaultAssetPickerProvider
333334 bool onlyAll = false ,
334335 bool keepPreviousCount = false ,
335336 }) async {
336- final PMFilter options;
337+ final PMFilter ? options;
337338 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 (
344341 imageOption: const FilterOption (
345342 sizeConstraint: SizeConstraint (ignoreSize: true ),
346343 ),
@@ -352,9 +349,11 @@ class DefaultAssetPickerProvider
352349 containsPathModified: sortPathsByModifiedDate,
353350 createTimeCond: DateTimeCond .def ().copyWith (ignore: true ),
354351 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)],
355356 );
356- newOptions.merge (fog);
357- options = newOptions;
358357 } else {
359358 options = fog;
360359 }
0 commit comments