Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…at_assets_picker

* 'main' of https://github.com/fluttercandies/flutter_wechat_assets_picker:
  docs: add Gasol as a contributor for translation (fluttercandies#669)
  Add Traditional Chinese localization (fluttercandies#667)
  🚀 Support matching script and country code of locales with the text delegate (fluttercandies#668)
  💡 Refreshes tests copyright
  🔖 9.4.1
  🔖 9.4.1
  Fix selecting when reached the max asset limit in the preview (fluttercandies#648)
  🚸 Improves the default sort conditions (fluttercandies#662)
  ⬆️ Allows `extended_image: ^9.0.0` (fluttercandies#659)
  🐛 Allows assets changing when no path previously (fluttercandies#656)
  👷 Try to run on minimum SDK requirement (fluttercandies#643)
  🔖 9.3.2
  🚀 Adapt the image provider file type getter (fluttercandies#638)
  🔖 9.3.1
  🐛 Fix UI layouts (fluttercandies#634)
  • Loading branch information
tourdt committed Dec 16, 2024
2 parents 074f932 + 2b8256e commit dd2daae
Show file tree
Hide file tree
Showing 26 changed files with 385 additions and 105 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,15 @@
"contributions": [
"code"
]
},
{
"login": "Gasol",
"name": "Gasol Wu",
"avatar_url": "https://avatars.githubusercontent.com/u/108053?v=4",
"profile": "http://about.me/gasol",
"contributions": [
"translation"
]
}
],
"contributorsPerLine": 7,
Expand Down
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
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,51 @@ 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

- Adapt the file type getter from the image provider to get a precise file type in grid.
- Adds the identifier for grid item's semantics.
- Improves preview page back button.

## 9.3.1

### Improvements

- Do not mute the Live Photo during the preview.

### Fixes

- Fix the GIF indicator's layout.
- Fix the directionality with the reverted grid item.

## 9.3.0

### New features
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ Many thanks to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://velog.io/@hee_mm_"><img src="https://avatars.githubusercontent.com/u/48482259?v=4?s=50" width="50px;" alt="mirimhee"/><br /><sub><b>mirimhee</b></sub></a><br /><a href="#translation-LIMMIHEE" title="Translation">🌍</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://amoshk.top"><img src="https://avatars.githubusercontent.com/u/32262985?v=4?s=50" width="50px;" alt="Amos"/><br /><sub><b>Amos</b></sub></a><br /><a href="https://github.com/fluttercandies/flutter_wechat_assets_picker/issues?q=author%3AAmosHuKe" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/Dimilkalathiya"><img src="https://avatars.githubusercontent.com/u/102401667?v=4?s=50" width="50px;" alt="Dimil Kalathiya"/><br /><sub><b>Dimil Kalathiya</b></sub></a><br /><a href="https://github.com/fluttercandies/flutter_wechat_assets_picker/commits?author=Dimilkalathiya" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://about.me/gasol"><img src="https://avatars.githubusercontent.com/u/108053?v=4?s=50" width="50px;" alt="Gasol Wu"/><br /><sub><b>Gasol Wu</b></sub></a><br /><a href="#translation-Gasol" title="Translation">🌍</a></td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit
import Flutter

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
8 changes: 4 additions & 4 deletions example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand Down Expand Up @@ -30,6 +32,8 @@
<string>Take a video for display</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Read your photos for display</string>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
Expand All @@ -47,9 +51,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
23 changes: 23 additions & 0 deletions example/lib/constants/picker_method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,29 @@ class PickMethod {
);
}

factory PickMethod.livePhoto(BuildContext context, int maxAssetsCount) {
return PickMethod(
icon: '🎬',
name: context.l10n.pickMethodLivePhotoName,
description: context.l10n.pickMethodLivePhotoDescription,
method: (BuildContext context, List<AssetEntity> assets) {
return AssetPicker.pickAssets(
context,
pickerConfig: AssetPickerConfig(
maxAssets: maxAssetsCount,
selectedAssets: assets,
requestType: RequestType.image,
filterOptions: CustomFilter.sql(
where: '${CustomColumns.base.mediaType} = 1'
' AND '
'${CustomColumns.darwin.mediaSubtypes} & (1 << 3) = (1 << 3)',
),
),
);
},
);
}

factory PickMethod.camera({
required BuildContext context,
required int maxAssetsCount,
Expand Down
2 changes: 2 additions & 0 deletions example/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
"pickMethodVideoDescription": "Only pick video from device. (Includes Live Photos on iOS and macOS.)",
"pickMethodAudioName": "Audio picker",
"pickMethodAudioDescription": "Only pick audio from device.",
"pickMethodLivePhotoName": "Live Photo picker",
"pickMethodLivePhotoDescription": "Only pick Live Photos from device.",
"pickMethodCameraName": "Pick from camera",
"pickMethodCameraDescription": "Allow to pick an asset through camera.",
"pickMethodCameraAndStayName": "Pick from camera and stay",
Expand Down
4 changes: 3 additions & 1 deletion example/lib/l10n/app_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
"pickMethodImageName": "图片选择",
"pickMethodImageDescription": "仅选择图片。",
"pickMethodVideoName": "视频选择",
"pickMethodVideoDescription": "仅选择视频。(在 iOS 和 macOS 上将包括实况图片。)",
"pickMethodVideoDescription": "仅选择视频。",
"pickMethodAudioName": "音频选择",
"pickMethodAudioDescription": "仅选择音频。",
"pickMethodLivePhotoName": "实况图片选择",
"pickMethodLivePhotoDescription": "仅选择实况图片。",
"pickMethodCameraName": "从相机生成选择",
"pickMethodCameraDescription": "通过相机拍照生成并选择资源",
"pickMethodCameraAndStayName": "从相机生成选择并停留",
Expand Down
14 changes: 14 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 Expand Up @@ -180,6 +182,18 @@ abstract class AppLocalizations {
/// **'Only pick audio from device.'**
String get pickMethodAudioDescription;

/// No description provided for @pickMethodLivePhotoName.
///
/// In en, this message translates to:
/// **'Live Photo picker'**
String get pickMethodLivePhotoName;

/// No description provided for @pickMethodLivePhotoDescription.
///
/// In en, this message translates to:
/// **'Only pick Live Photos from device.'**
String get pickMethodLivePhotoDescription;

/// No description provided for @pickMethodCameraName.
///
/// In en, this message translates to:
Expand Down
9 changes: 9 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 Expand Up @@ -51,6 +53,13 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get pickMethodAudioDescription => 'Only pick audio from device.';

@override
String get pickMethodLivePhotoName => 'Live Photo picker';

@override
String get pickMethodLivePhotoDescription =>
'Only pick Live Photos from device.';

@override
String get pickMethodCameraName => 'Pick from camera';

Expand Down
10 changes: 9 additions & 1 deletion 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 Expand Up @@ -42,14 +44,20 @@ class AppLocalizationsZh extends AppLocalizations {
String get pickMethodVideoName => '视频选择';

@override
String get pickMethodVideoDescription => '仅选择视频。(在 iOS 和 macOS 上将包括实况图片。)';
String get pickMethodVideoDescription => '仅选择视频。';

@override
String get pickMethodAudioName => '音频选择';

@override
String get pickMethodAudioDescription => '仅选择音频。';

@override
String get pickMethodLivePhotoName => '实况图片选择';

@override
String get pickMethodLivePhotoDescription => '仅选择实况图片。';

@override
String get pickMethodCameraName => '从相机生成选择';

Expand Down
4 changes: 4 additions & 0 deletions example/lib/pages/multi_assets_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by an Apache license that can be found
// in the LICENSE file.

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:wechat_assets_picker/wechat_assets_picker.dart';

Expand Down Expand Up @@ -32,6 +34,8 @@ class _MultiAssetsPageState extends State<MultiAssetsPage>
PickMethod.image(context, maxAssetsCount),
PickMethod.video(context, maxAssetsCount),
PickMethod.audio(context, maxAssetsCount),
if (Platform.isIOS || Platform.isMacOS)
PickMethod.livePhoto(context, maxAssetsCount),
PickMethod.camera(
context: context,
maxAssetsCount: maxAssetsCount,
Expand Down
4 changes: 4 additions & 0 deletions example/lib/pages/single_assets_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Use of this source code is governed by an Apache license that can be found
// in the LICENSE file.

import 'dart:io';

import 'package:flutter/material.dart';
import 'package:wechat_assets_picker/wechat_assets_picker.dart'
show AssetEntity;
Expand Down Expand Up @@ -32,6 +34,8 @@ class _SingleAssetPageState extends State<SingleAssetPage>
PickMethod.image(context, maxAssetsCount),
PickMethod.video(context, maxAssetsCount),
PickMethod.audio(context, maxAssetsCount),
if (Platform.isIOS || Platform.isMacOS)
PickMethod.livePhoto(context, maxAssetsCount),
PickMethod.camera(
context: context,
maxAssetsCount: maxAssetsCount,
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.2.1+57
version: 9.4.1+63
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
Loading

0 comments on commit dd2daae

Please sign in to comment.