Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into feat/generic-delegates
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Nov 21, 2024
2 parents 6cc49c8 + c8c3ea0 commit a37ef5e
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 20 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/runnable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -58,15 +66,19 @@ jobs:
- uses: subosito/[email protected]
with:
channel: stable
flutter-version: ${{ matrix.flutter-version == 'min' && env.MINIMUM_FLUTTER_VERSION || '' }}
- run: dart --version
- run: flutter --version
- run: flutter pub get
- run: cd example; flutter build ios --no-codesign

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
Expand All @@ -76,6 +88,7 @@ jobs:
- uses: subosito/[email protected]
with:
channel: stable
flutter-version: ${{ matrix.flutter-version == 'min' && env.MINIMUM_FLUTTER_VERSION || '' }}
- run: dart --version
- run: flutter --version
- run: flutter pub get
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,32 @@ that can be found in the LICENSE file. -->

*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

- Allows `extended_image: ^9.0.0`.

### Fixes

- Allows assets changing when no path previously.

## 9.3.3

### Fixes

- Recovers the compatibility with Flutter 3.16.

## 9.3.2

### Improvements
Expand Down
2 changes: 2 additions & 0 deletions example/lib/l10n/gen/app_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)`.
///
Expand Down
2 changes: 2 additions & 0 deletions example/lib/l10n/gen/app_localizations_en.dart
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
2 changes: 2 additions & 0 deletions example/lib/l10n/gen/app_localizations_zh.dart
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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.4.0+62
publish_to: none

environment:
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/src/delegates/asset_picker_builder_delegate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ class DefaultAssetPickerBuilderDelegate<T extends DefaultAssetPickerProvider>
if (assetsChangeRefreshPredicate != null) {
return assetsChangeRefreshPredicate!(permission, call, path);
}
return path?.isAll == true;
return path?.isAll ?? true;
}

if (!predicate()) {
Expand Down Expand Up @@ -1496,11 +1496,11 @@ class DefaultAssetPickerBuilderDelegate<T extends DefaultAssetPickerProvider>
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', '')}',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ abstract class AssetPickerViewerBuilderDelegate<Asset, Path,
}

void selectAsset(Asset entity) {
if (maxAssets != null && selectedCount >= maxAssets!) {
if (maxAssets != null && selectedCount > maxAssets!) {
return;
}
provider?.selectAsset(entity);
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
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: wechat_assets_picker
version: 9.3.2
version: 9.4.1
description: |
An image picker (also with videos and audio)
for Flutter projects based on WeChat's UI,
Expand All @@ -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
Expand Down

0 comments on commit a37ef5e

Please sign in to comment.