From 4d2de12dd601617c4db67c7ef11f538bec6346af Mon Sep 17 00:00:00 2001 From: Alex Li Date: Thu, 17 Oct 2024 19:32:10 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=91=B7=20Try=20to=20run=20on=20minimu?= =?UTF-8?q?m=20SDK=20requirement=20(#643)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/runnable.yml | 19 ++++++++++++++++--- CHANGELOG.md | 6 ++++++ example/pubspec.yaml | 2 +- .../asset_picker_builder_delegate.dart | 2 +- pubspec.yaml | 2 +- 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.github/workflows/runnable.yml b/.github/workflows/runnable.yml index 9eb5bd52..d5bf1750 100644 --- a/.github/workflows/runnable.yml +++ b/.github/workflows/runnable.yml @@ -12,13 +12,17 @@ on: paths-ignore: - "**.md" +env: + MINIMUM_FLUTTER_VERSION: '3.16.0' + jobs: analyze: - name: Analyze on ${{ matrix.os }} + name: Analyze on ${{ matrix.os }} with ${{ matrix.flutter-version }} Flutter runs-on: ${{ matrix.os }} strategy: matrix: os: [ ubuntu-latest ] + flutter-version: [ min, latest ] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -28,6 +32,7 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: 'stable' + flutter-version: ${{ matrix.flutter-version == 'min' && env.MINIMUM_FLUTTER_VERSION || '' }} - name: Log Dart/Flutter versions run: | dart --version @@ -47,8 +52,11 @@ jobs: test_iOS: needs: analyze - name: Test iOS + name: Test iOS with ${{ matrix.flutter-version }} Flutter runs-on: macos-latest + strategy: + matrix: + flutter-version: [ min, latest ] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -58,6 +66,7 @@ jobs: - uses: subosito/flutter-action@v2.8.0 with: channel: stable + flutter-version: ${{ matrix.flutter-version == 'min' && env.MINIMUM_FLUTTER_VERSION || '' }} - run: dart --version - run: flutter --version - run: flutter pub get @@ -65,8 +74,11 @@ jobs: test_android: needs: analyze - name: Test Android + name: Test Android with ${{ matrix.flutter-version }} Flutter runs-on: ubuntu-latest + strategy: + matrix: + flutter-version: [ min, latest ] steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -76,6 +88,7 @@ jobs: - uses: subosito/flutter-action@v2.8.0 with: channel: stable + flutter-version: ${{ matrix.flutter-version == 'min' && env.MINIMUM_FLUTTER_VERSION || '' }} - run: dart --version - run: flutter --version - run: flutter pub get diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d0dced6..e69eff09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,12 @@ that can be found in the LICENSE file. --> *None.* +## 9.3.3 + +### Fixes + +- Recovers the compatibility with Flutter 3.16. + ## 9.3.2 ### Improvements diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 8c3ac8d2..c91ecf88 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,6 @@ name: wechat_assets_picker_demo description: The demo project for the wechat_assets_picker package. -version: 9.3.2+60 +version: 9.3.3+61 publish_to: none environment: diff --git a/lib/src/delegates/asset_picker_builder_delegate.dart b/lib/src/delegates/asset_picker_builder_delegate.dart index 96c402c1..cff1802c 100644 --- a/lib/src/delegates/asset_picker_builder_delegate.dart +++ b/lib/src/delegates/asset_picker_builder_delegate.dart @@ -1500,11 +1500,11 @@ class DefaultAssetPickerBuilderDelegate hint += ', ${asset.title}'; } return Semantics( + key: ValueKey('${asset.id}-semantics'), button: false, enabled: !isBanned, excludeSemantics: true, focusable: !isSwitchingPath, - identifier: asset.id, label: '${semanticsTextDelegate.semanticTypeLabel(asset.type)}' '${semanticIndex(index)}, ' '${asset.createDateTime.toString().replaceAll('.000', '')}', diff --git a/pubspec.yaml b/pubspec.yaml index bca3d36d..4a02d12c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: wechat_assets_picker -version: 9.3.2 +version: 9.3.3 description: | An image picker (also with videos and audio) for Flutter projects based on WeChat's UI, From c6720cdaa10c949c4dc6be3420b064ca7b1c81ac Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 8 Nov 2024 13:22:14 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=90=9B=20Allows=20assets=20changing?= =?UTF-8?q?=20when=20no=20path=20previously=20(#656)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves https://github.com/fluttercandies/flutter_photo_manager/issues/1215 --- CHANGELOG.md | 4 +++- lib/src/delegates/asset_picker_builder_delegate.dart | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69eff09..8af74669 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,9 @@ that can be found in the LICENSE file. --> ## Unreleased -*None.* +### Fixes + +- Allows assets changing when no path previously. ## 9.3.3 diff --git a/lib/src/delegates/asset_picker_builder_delegate.dart b/lib/src/delegates/asset_picker_builder_delegate.dart index cff1802c..aa85ec03 100644 --- a/lib/src/delegates/asset_picker_builder_delegate.dart +++ b/lib/src/delegates/asset_picker_builder_delegate.dart @@ -901,7 +901,7 @@ class DefaultAssetPickerBuilderDelegate if (assetsChangeRefreshPredicate != null) { return assetsChangeRefreshPredicate!(permission, call, path); } - return path?.isAll == true; + return path?.isAll ?? true; } if (!predicate()) { From 2d51c424d0683de106244f612bdae20faada1503 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Fri, 8 Nov 2024 13:48:26 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Allows=20`extended=5Fi?= =?UTF-8?q?mage:=20^9.0.0`=20(#659)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #652 --- CHANGELOG.md | 8 ++++++++ example/lib/l10n/gen/app_localizations.dart | 2 ++ example/lib/l10n/gen/app_localizations_en.dart | 2 ++ example/lib/l10n/gen/app_localizations_zh.dart | 2 ++ example/pubspec.yaml | 6 +++--- pubspec.yaml | 4 ++-- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8af74669..9f84c0cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,14 @@ that can be found in the LICENSE file. --> ## Unreleased +**None.** + +## 9.4.0 + +### Improvements + +- Allows `extended_image: ^9.0.0`. + ### Fixes - Allows assets changing when no path previously. diff --git a/example/lib/l10n/gen/app_localizations.dart b/example/lib/l10n/gen/app_localizations.dart index dd848222..9cf300a3 100644 --- a/example/lib/l10n/gen/app_localizations.dart +++ b/example/lib/l10n/gen/app_localizations.dart @@ -8,6 +8,8 @@ import 'package:intl/intl.dart' as intl; import 'app_localizations_en.dart'; import 'app_localizations_zh.dart'; +// ignore_for_file: type=lint + /// Callers can lookup localized strings with an instance of AppLocalizations /// returned by `AppLocalizations.of(context)`. /// diff --git a/example/lib/l10n/gen/app_localizations_en.dart b/example/lib/l10n/gen/app_localizations_en.dart index b8238fef..6419ff94 100644 --- a/example/lib/l10n/gen/app_localizations_en.dart +++ b/example/lib/l10n/gen/app_localizations_en.dart @@ -1,5 +1,7 @@ import 'app_localizations.dart'; +// ignore_for_file: type=lint + /// The translations for English (`en`). class AppLocalizationsEn extends AppLocalizations { AppLocalizationsEn([String locale = 'en']) : super(locale); diff --git a/example/lib/l10n/gen/app_localizations_zh.dart b/example/lib/l10n/gen/app_localizations_zh.dart index 0d4f2e66..3306b449 100644 --- a/example/lib/l10n/gen/app_localizations_zh.dart +++ b/example/lib/l10n/gen/app_localizations_zh.dart @@ -1,5 +1,7 @@ import 'app_localizations.dart'; +// ignore_for_file: type=lint + /// The translations for Chinese (`zh`). class AppLocalizationsZh extends AppLocalizations { AppLocalizationsZh([String locale = 'zh']) : super(locale); diff --git a/example/pubspec.yaml b/example/pubspec.yaml index c91ecf88..91ee8f83 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,6 @@ name: wechat_assets_picker_demo description: The demo project for the wechat_assets_picker package. -version: 9.3.3+61 +version: 9.4.0+62 publish_to: none environment: @@ -17,11 +17,11 @@ dependencies: path: ../ wechat_camera_picker: ^4.2.0 - extended_image: ^8.3.0 + extended_image: any package_info_plus: '>=5.0.0 <9.0.0' path: ^1.8.0 path_provider: ^2.0.15 - provider: ^6.0.2 + provider: any dev_dependencies: flutter_lints: any diff --git a/pubspec.yaml b/pubspec.yaml index 4a02d12c..7bc04ea8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: wechat_assets_picker -version: 9.3.3 +version: 9.4.0 description: | An image picker (also with videos and audio) for Flutter projects based on WeChat's UI, @@ -24,7 +24,7 @@ dependencies: wechat_picker_library: ^1.0.5 - extended_image: ^8.3.0 + extended_image: '>=8.3.0 <10.0.0' photo_manager: ^3.5.0 photo_manager_image_provider: ^2.2.0 provider: ^6.0.5 From 29c2b8aca26cc70cc8180c23ff4f84b6c0846ea3 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Thu, 21 Nov 2024 22:36:23 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=9A=B8=20Improves=20the=20default=20s?= =?UTF-8?q?ort=20conditions=20(#662)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 +++- lib/src/provider/asset_picker_provider.dart | 17 ++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f84c0cc..c893664d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,9 @@ that can be found in the LICENSE file. --> ## Unreleased -**None.** +### Improvements + +- Improves the default sort conditions. ## 9.4.0 diff --git a/lib/src/provider/asset_picker_provider.dart b/lib/src/provider/asset_picker_provider.dart index 4938fe15..16ec896e 100644 --- a/lib/src/provider/asset_picker_provider.dart +++ b/lib/src/provider/asset_picker_provider.dart @@ -3,6 +3,7 @@ // in the LICENSE file. import 'dart:async'; +import 'dart:io'; import 'dart:math' as math; import 'dart:typed_data'; @@ -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), ), @@ -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; } From dc5911e89705854cc7ffbacf0c8be372fca4adfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=93=E5=A4=A7=E5=AE=9D?= Date: Thu, 21 Nov 2024 23:10:23 +0800 Subject: [PATCH 5/6] Fix selecting when reached the max asset limit in the preview (#648) Fixes #607 --------- Co-authored-by: Alex Li --- lib/src/delegates/asset_picker_viewer_builder_delegate.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/delegates/asset_picker_viewer_builder_delegate.dart b/lib/src/delegates/asset_picker_viewer_builder_delegate.dart index 8f386724..e2c5f1fc 100644 --- a/lib/src/delegates/asset_picker_viewer_builder_delegate.dart +++ b/lib/src/delegates/asset_picker_viewer_builder_delegate.dart @@ -272,7 +272,7 @@ abstract class AssetPickerViewerBuilderDelegate { } void selectAsset(Asset entity) { - if (maxAssets != null && selectedCount >= maxAssets!) { + if (maxAssets != null && selectedCount > maxAssets!) { return; } provider?.selectAsset(entity); From c8c3ea0fbea198651cd93bbc86d430a5d5ac33d5 Mon Sep 17 00:00:00 2001 From: Alex Li Date: Thu, 21 Nov 2024 23:14:22 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=94=96=209.4.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 8 ++++++++ pubspec.yaml | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c893664d..eaad6663 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,18 @@ that can be found in the LICENSE file. --> ## Unreleased +*None.* + +## 9.4.1 + ### Improvements - Improves the default sort conditions. +### Fixes + +- Fixes selecting when reached the max asset limit in the preview. + ## 9.4.0 ### Improvements diff --git a/pubspec.yaml b/pubspec.yaml index 7bc04ea8..b227f2db 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: wechat_assets_picker -version: 9.4.0 +version: 9.4.1 description: | An image picker (also with videos and audio) for Flutter projects based on WeChat's UI,