Skip to content

Commit a37ef5e

Browse files
committed
Merge branch 'refs/heads/main' into feat/generic-delegates
2 parents 6cc49c8 + c8c3ea0 commit a37ef5e

10 files changed

+64
-20
lines changed

.github/workflows/runnable.yml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ on:
1212
paths-ignore:
1313
- "**.md"
1414

15+
env:
16+
MINIMUM_FLUTTER_VERSION: '3.16.0'
17+
1518
jobs:
1619
analyze:
17-
name: Analyze on ${{ matrix.os }}
20+
name: Analyze on ${{ matrix.os }} with ${{ matrix.flutter-version }} Flutter
1821
runs-on: ${{ matrix.os }}
1922
strategy:
2023
matrix:
2124
os: [ ubuntu-latest ]
25+
flutter-version: [ min, latest ]
2226
steps:
2327
- uses: actions/checkout@v4
2428
- uses: actions/setup-java@v4
@@ -28,6 +32,7 @@ jobs:
2832
- uses: subosito/flutter-action@v2
2933
with:
3034
channel: 'stable'
35+
flutter-version: ${{ matrix.flutter-version == 'min' && env.MINIMUM_FLUTTER_VERSION || '' }}
3136
- name: Log Dart/Flutter versions
3237
run: |
3338
dart --version
@@ -47,8 +52,11 @@ jobs:
4752
4853
test_iOS:
4954
needs: analyze
50-
name: Test iOS
55+
name: Test iOS with ${{ matrix.flutter-version }} Flutter
5156
runs-on: macos-latest
57+
strategy:
58+
matrix:
59+
flutter-version: [ min, latest ]
5260
steps:
5361
- uses: actions/checkout@v4
5462
- uses: actions/setup-java@v4
@@ -58,15 +66,19 @@ jobs:
5866
- uses: subosito/[email protected]
5967
with:
6068
channel: stable
69+
flutter-version: ${{ matrix.flutter-version == 'min' && env.MINIMUM_FLUTTER_VERSION || '' }}
6170
- run: dart --version
6271
- run: flutter --version
6372
- run: flutter pub get
6473
- run: cd example; flutter build ios --no-codesign
6574

6675
test_android:
6776
needs: analyze
68-
name: Test Android
77+
name: Test Android with ${{ matrix.flutter-version }} Flutter
6978
runs-on: ubuntu-latest
79+
strategy:
80+
matrix:
81+
flutter-version: [ min, latest ]
7082
steps:
7183
- uses: actions/checkout@v4
7284
- uses: actions/setup-java@v4
@@ -76,6 +88,7 @@ jobs:
7688
- uses: subosito/[email protected]
7789
with:
7890
channel: stable
91+
flutter-version: ${{ matrix.flutter-version == 'min' && env.MINIMUM_FLUTTER_VERSION || '' }}
7992
- run: dart --version
8093
- run: flutter --version
8194
- run: flutter pub get

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,32 @@ that can be found in the LICENSE file. -->
1111

1212
*None.*
1313

14+
## 9.4.1
15+
16+
### Improvements
17+
18+
- Improves the default sort conditions.
19+
20+
### Fixes
21+
22+
- Fixes selecting when reached the max asset limit in the preview.
23+
24+
## 9.4.0
25+
26+
### Improvements
27+
28+
- Allows `extended_image: ^9.0.0`.
29+
30+
### Fixes
31+
32+
- Allows assets changing when no path previously.
33+
34+
## 9.3.3
35+
36+
### Fixes
37+
38+
- Recovers the compatibility with Flutter 3.16.
39+
1440
## 9.3.2
1541

1642
### Improvements

example/lib/l10n/gen/app_localizations.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import 'package:intl/intl.dart' as intl;
88
import 'app_localizations_en.dart';
99
import 'app_localizations_zh.dart';
1010

11+
// ignore_for_file: type=lint
12+
1113
/// Callers can lookup localized strings with an instance of AppLocalizations
1214
/// returned by `AppLocalizations.of(context)`.
1315
///

example/lib/l10n/gen/app_localizations_en.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'app_localizations.dart';
22

3+
// ignore_for_file: type=lint
4+
35
/// The translations for English (`en`).
46
class AppLocalizationsEn extends AppLocalizations {
57
AppLocalizationsEn([String locale = 'en']) : super(locale);

example/lib/l10n/gen/app_localizations_zh.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import 'app_localizations.dart';
22

3+
// ignore_for_file: type=lint
4+
35
/// The translations for Chinese (`zh`).
46
class AppLocalizationsZh extends AppLocalizations {
57
AppLocalizationsZh([String locale = 'zh']) : super(locale);

example/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: wechat_assets_picker_demo
22
description: The demo project for the wechat_assets_picker package.
3-
version: 9.3.2+60
3+
version: 9.4.0+62
44
publish_to: none
55

66
environment:
@@ -17,11 +17,11 @@ dependencies:
1717
path: ../
1818
wechat_camera_picker: ^4.2.0
1919

20-
extended_image: ^8.3.0
20+
extended_image: any
2121
package_info_plus: '>=5.0.0 <9.0.0'
2222
path: ^1.8.0
2323
path_provider: ^2.0.15
24-
provider: ^6.0.2
24+
provider: any
2525

2626
dev_dependencies:
2727
flutter_lints: any

lib/src/delegates/asset_picker_builder_delegate.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ class DefaultAssetPickerBuilderDelegate<T extends DefaultAssetPickerProvider>
899899
if (assetsChangeRefreshPredicate != null) {
900900
return assetsChangeRefreshPredicate!(permission, call, path);
901901
}
902-
return path?.isAll == true;
902+
return path?.isAll ?? true;
903903
}
904904

905905
if (!predicate()) {
@@ -1496,11 +1496,11 @@ class DefaultAssetPickerBuilderDelegate<T extends DefaultAssetPickerProvider>
14961496
hint += ', ${asset.title}';
14971497
}
14981498
return Semantics(
1499+
key: ValueKey('${asset.id}-semantics'),
14991500
button: false,
15001501
enabled: !isBanned,
15011502
excludeSemantics: true,
15021503
focusable: !isSwitchingPath,
1503-
identifier: asset.id,
15041504
label: '${semanticsTextDelegate.semanticTypeLabel(asset.type)}'
15051505
'${semanticIndex(index)}, '
15061506
'${asset.createDateTime.toString().replaceAll('.000', '')}',

lib/src/delegates/asset_picker_viewer_builder_delegate.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ abstract class AssetPickerViewerBuilderDelegate<Asset, Path,
268268
}
269269

270270
void selectAsset(Asset entity) {
271-
if (maxAssets != null && selectedCount >= maxAssets!) {
271+
if (maxAssets != null && selectedCount > maxAssets!) {
272272
return;
273273
}
274274
provider?.selectAsset(entity);

lib/src/provider/asset_picker_provider.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// in the LICENSE file.
44

55
import 'dart:async';
6+
import 'dart:io';
67
import 'dart:math' as math;
78
import '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
}

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: wechat_assets_picker
2-
version: 9.3.2
2+
version: 9.4.1
33
description: |
44
An image picker (also with videos and audio)
55
for Flutter projects based on WeChat's UI,
@@ -24,7 +24,7 @@ dependencies:
2424

2525
wechat_picker_library: ^1.0.5
2626

27-
extended_image: ^8.3.0
27+
extended_image: '>=8.3.0 <10.0.0'
2828
photo_manager: ^3.5.0
2929
photo_manager_image_provider: ^2.2.0
3030
provider: ^6.0.5

0 commit comments

Comments
 (0)