GithubHelp home page GithubHelp logo

fluttercandies / flutter_wechat_assets_picker Goto Github PK

View Code? Open in Web Editor NEW
1.5K 13.0 418.0 29.24 MB

An image picker (also with video and audio) for Flutter projects based on the WeChat's UI.

Home Page: https://pub.dev/packages/wechat_assets_picker

License: Apache License 2.0

Dart 98.88% Kotlin 0.05% Ruby 0.63% Swift 0.38% Objective-C 0.01% Java 0.05%
flutter wechat multiple-assets mobile macos picker android ios video

flutter_wechat_assets_picker's Introduction

Flutter WeChat Assets Picker

pub package pub package CodeFactor

Build status GitHub license GitHub stars GitHub forks

Awesome Flutter Flutter Candies QQ群

Language: English | 中文

An image picker (also with videos and audios) for Flutter projects based on the WeChat's UI.

Current WeChat version that UI based on: 8.3.x UI designs will be updated following the WeChat update in anytime.

To take a photo or a video for assets, please check the detailed usage in the example, and head over to wechat_camera_picker. The package is a standalone extension that can to be used with combination.

See the Migration Guide to learn how to migrate between breaking changes.

Versions compatibility

The package only guarantees to be working on the stable version of Flutter. We won't update it in real-time to align with other channels of Flutter.

3.0 3.3 3.7 3.10 3.13 3.16
8.9.0+
8.7.0+
8.5.0+
8.4.0+
8.0.0+
7.3.0+

If you got a resolve conflict error when running flutter pub get, please use dependency_overrides to fix it.

Package credits

The package is built from these wonderful packages.

Name Features
photo_manager The basic abstractions and management for assets.
extended_image Preview assets with expected behaviors.
provider Helps to manage the interaction state of the picker.
video_player Plays videos and audios correspondingly.

Their implementation should be relatively stable in the package. If you've found any issues related to them when using the picker, submit issues to our issue tracker first.

Table of content

Features ✨

  • ♿ Complete a11y support with TalkBack and VoiceOver
  • ♻️ Fully customizable with delegates override
  • 🎏 Fully customizable theme based on ThemeData
  • 💚 Completely WeChat style (even more)
  • ⚡️ Adjustable performance with different configurations
  • 📷 Image support
    • 🔬 HEIF Image type support (1)
  • 🎥 Video support
  • 🎶 Audio support (2)
  • 1️⃣ Single picking mode
  • 💱 Internationalization (i18n) support
    • ⏪ RTL language support
  • ➕ Special item builder support
  • 🗂 Custom sort path delegate support
  • 📝 Custom text delegate support
  • ⏳ Custom filter options support
  • 💻 macOS support

Notes 📝

  1. HEIF (HEIC) images are support to obtain and conversion, but the display with them are based on Flutter's image decoder. See flutter/flutter#20522. Use entity.file or AssetEntityImage for them when displays.
  2. Due to limitations on iOS and macOS, audio can only be fetched within the sandbox.

Projects using this plugin 🖼️

name pub github
insta_assets_picker pub package star

Screenshots 📸

1 2 3
4 5 6
7 8 9
10 10 12

READ THIS FIRST ‼️

Be aware of below notices before you started anything:

  • Due to understanding differences and the limitation of a single document, documents will not cover all the contents. If you find nothing related to your expected features and cannot understand about concepts, run the example project and check every options first. It has covered 90% of regular requests with the package.
  • The package deeply integrates with the photo_manager plugin, make sure you understand these two concepts as much as possible:

When you have questions about related APIs and behaviors, check photo_manager's API docs for more details.

Most usages are detailed covered by the example. Please walk through the example carefully before you have any questions.

Preparing for use 🍭

Flutter

Run flutter pub add wechat_assets_picker, or add wechat_assets_picker to pubspec.yaml dependencies manually.

dependencies:
  wechat_assets_picker: ^latest_version

The latest stable version is: pub package

The latest dev version is: pub package

Then import the package in your code:

import 'package:wechat_assets_picker/wechat_assets_picker.dart';

Android

When using the package, please upgrade targetSdkVersion and compileSdkVersion to 33. Otherwise, no assets can be fetched on Android 13.

Permissions

Name Required Declared Max API Level Others
READ_EXTERNAL_STORAGE YES YES 32
WRITE_EXTERNAL_STORAGE NO NO 29
ACCESS_MEDIA_LOCATION YES* NO N/A Required when reading EXIF
READ_MEDIA_IMAGES YES* YES N/A Required when reading images
READ_MEDIA_VIDEO YES* YES N/A Required when reading videos
READ_MEDIA_AUDIO YES* YES N/A Required when reading audios

If you're targeting Android SDK 33+, and you don't need to load photos, videos or audios, consider declare only relevant permission in your apps, more specifically:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.your.app">
    <!--Requesting access to images and videos.-->
    <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
    <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
    <!--When your app has no need to access audio, remove it or comment it out.-->
    <!--<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />-->
</manifest>

iOS

  1. Platform version has to be at least 11.0. Modify ios/Podfile and update accordingly.
    platform :ios, '11.0'
    
    Remove the # heading if the line starts with it.
  2. Add the following content to Info.plist.
<key>NSPhotoLibraryUsageDescription</key>
<string>Replace with your permission description.</string>

macOS

  1. Platform version has to be at least 10.15. Modify macos/Podfile and update accordingly.
    platform :osx, '10.15'
    Remove the # heading if the line starts with it.
  2. Set the minimum deployment target of the macOS to 10.15. Use XCode to open macos/Runner.xcworkspace .
  3. Follow the iOS instructions and modify Info.plist accordingly.

Usage 📖

Localizations

When you're picking assets, the package will obtain the Locale? from your BuildContext, and return the corresponding text delegate of the current language. Make sure you have a valid Locale in your widget tree that can be accessed from the BuildContext. Otherwise, the default Chinese delegate will be used.

Embedded text delegates languages are:

  • 简体中文 (default)
  • English
  • העברית
  • Deutsche
  • Локализация
  • 日本語
  • مة العربية
  • Délégué
  • Tiếng Việt
  • Türkçe Yerelleştirme

If you want to use a custom/fixed text delegate, pass it through the AssetPickerConfig.textDelegate.

Simple usage

final List<AssetEntity>? result = await AssetPicker.pickAssets(context);

Use AssetPickerConfig for more picking behaviors.

final List<AssetEntity>? result = await AssetPicker.pickAssets(
  context,
  pickerConfig: const AssetPickerConfig(),
);

Fields in AssetPickerConfig:

Name Type Description Default
selectedAssets List<AssetEntity>? Selected assets. Prevent duplicate selection. null
maxAssets int Maximum asset that the picker can pick. 9
pageSize int? Number of assets per page. Must be a multiple of gridCount. 80
gridThumbnailSize ThumbnailSize Thumbnail size for the grid's item. ThumbnailSize.square(200)
pathThumbnailSize ThumbnailSize Thumbnail size for the path selector. ThumbnailSize.square(80)
previewThumbnailSize ThumbnailSize? Preview thumbnail size in the viewer. null
requestType RequestType Request type for picker. RequestType.common
specialPickerType SpecialPickerType? Provides the option to integrate a custom picker type. null
keepScrollOffset bool Whether the picker should save the scroll offset between pushes and pops. null
sortPathDelegate SortPathDelegate<AssetPathEntity>? Path entities sort delegate for the picker, sort paths as you want. CommonSortPathDelegate
sortPathsByModifiedDate bool Whether to allow sort delegates to sort paths with FilterOptionGroup.containsPathModified. false
filterOptions PMFilter? Allow users to customize assets filter options. null
gridCount int Grid count in picker. 4
themeColor Color? Main theme color for the picker. Color(0xff00bc56)
pickerTheme ThemeData? Theme data provider for the picker and the viewer. null
textDelegate AssetPickerTextDelegate? Text delegate for the picker, for customize the texts. AssetPickerTextDelegate()
specialItemPosition SpecialItemPosition Allow users set a special item in the picker with several positions. SpecialItemPosition.none
specialItemBuilder SpecialItemBuilder? The widget builder for the special item. null
loadingIndicatorBuilder IndicatorBuilder? Indicates the loading status for the builder. null
selectPredicate AssetSelectPredicate Predicate whether an asset can be selected or unselected. null
shouldRevertGrid bool? Whether the assets grid should revert. null
limitedPermissionOverlayPredicate LimitedPermissionOverlayPredicate? Predicate whether the limited permission overlay should be displayed. null
pathNameBuilder PathNameBuilder<AssetPathEntity>? Build customized path (album) name with the given path entity. null
  • When maxAssets equals to 1 (a.k.a. single picking mode), use SpecialPickerType.noPreview will immediately select asset clicked (pressed) by the user and popped.
  • limitedPermissionOverlayPredicate lives without persistence, if you want to ignore the limited preview after restart, you'll need to integrate with your own saving methods.

Detailed usage

We've put multiple common usage with the packages in the example. You can both found List<PickMethod> pickMethods in here and here, which provide methods in multiple picking and single picking mode. Assets will be stored temporary and displayed at the below of the page.

Display selected assets

The AssetEntityImage and AssetEntityImageProvider can display the thumb image of images & videos, and the original data of image. Use it like a common Image and ImageProvider.

AssetEntityImage(asset, isOriginal: false);

Or:

Image(image: AssetEntityImageProvider(asset, isOriginal: false));

Register assets change observe callback

// Register callback.
AssetPicker.registerObserve();

// Unregister callback.
AssetPicker.unregisterObserve();

Upload an AssetEntity with a form data

There are multiple ways to upload an AssetEntity with I/O related methods. Be aware, I/O related methods will consume performance (typically time and memory), they should not be called frequently.

With http

http package: https://pub.dev/packages/http

The http package uses MultipartFile to handle files in requests.

Pseudo code:

import 'package:http/http.dart' as http;

Future<void> upload() async {
  final entity = await obtainYourEntity();
  final uri = Uri.https('example.com', 'create');
  final request = http.MultipartRequest('POST', uri)
    ..fields['test_field'] = 'test_value'
    ..files.add(await multipartFileFromAssetEntity(entity));
  final response = await request.send();
  if (response.statusCode == 200) {
    print('Uploaded!');
  }
}

Future<http.MultipartFile> multipartFileFromAssetEntity(AssetEntity entity) async {
  http.MultipartFile mf;
  // Using the file path.
  final file = await entity.file;
  if (file == null) {
    throw StateError('Unable to obtain file of the entity ${entity.id}.');
  }
  mf = await http.MultipartFile.fromPath('test_file', file.path);
  // Using the bytes.
  final bytes = await entity.originBytes;
  if (bytes == null) {
    throw StateError('Unable to obtain bytes of the entity ${entity.id}.');
  }
  mf = http.MultipartFile.fromBytes('test_file', bytes);
  return mf;
}
With dio

dio package: https://pub.dev/packages/dio

The dio package also uses MultipartFile to handle files in requests.

Pseudo code:

import 'package:dio/dio.dart' as dio;

Future<void> upload() async {
  final entity = await obtainYourEntity();
  final uri = Uri.https('example.com', 'create');
  final response = dio.Dio().requestUri(
    uri,
    data: dio.FormData.fromMap({
      'test_field': 'test_value',
      'test_file': await multipartFileFromAssetEntity(entity),
    }),
  );
  print('Uploaded!');
}

Future<dio.MultipartFile> multipartFileFromAssetEntity(AssetEntity entity) async {
  dio.MultipartFile mf;
  // Using the file path.
  final file = await entity.file;
  if (file == null) {
    throw StateError('Unable to obtain file of the entity ${entity.id}.');
  }
  mf = await dio.MultipartFile.fromFile(file.path);
  // Using the bytes.
  final bytes = await entity.originBytes;
  if (bytes == null) {
    throw StateError('Unable to obtain bytes of the entity ${entity.id}.');
  }
  mf = dio.MultipartFile.fromBytes(bytes);
  return mf;
}

Custom pickers

AssetPickerBuilderDelegate, AssetPickerViewerBuilderDelegate, AssetPickerProvider and AssetPickerViewerProvider are all exposed and overridable. You can extend them and use your own type with generic type <A: Asset, P: Path>, then implement abstract methods.

To know about how to fully customize themes, widgets or layouts. See how to customize delegates in the custom pickers page in the example.

You can submit PRs to create your own implementation if you found your implementation might be useful for others. See Contribute custom implementations for more details.

Frequently asked question ❔

Execution failed for task ':photo_manager:compileDebugKotlin'

See photo_manager#561 for more details.

Create AssetEntity from File or Uint8List (rawData)

In order to combine this package with camera shooting or something related, there's a solution about how to create an AssetEntity with File or Uint8List object.

final File file = your_file; // Your `File` object
final String path = file.path;
final AssetEntity fileEntity = await PhotoManager.editor.saveImageWithPath(
  path,
  title: basename(path),
); // Saved in the device then create an AssetEntity

final Uint8List data = your_data; // Your `Uint8List` object
final AssetEntity imageEntity = await PhotoManager.editor.saveImage(
  file.path,
  title: 'title_with_extension.jpg',
); // Saved in the device then create an AssetEntity

Notice: If you don't want to keep the file in your device, use File for operations as much as possible. Deleting an AssetEntity might cause system popups show:

final List<String> result = await PhotoManager.editor.deleteWithIds(
  <String>[entity.id],
);

See photo_manager#from-raw-data and photo_manager#delete-entities for more details.

Glide warning 'Failed to find GeneratedAppGlideModule'

W/Glide   (21133): Failed to find GeneratedAppGlideModule. 
                   You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler
                   in you application ana a @GlideModule annotated AppGlideModule implementation
                   or LibraryGlideModules will be silently ignored.

Glide needs annotation to keep singleton, prevent conflict between instances and versions, so while the photo manager uses Glide to implement image features, the project which import this should define its own AppGlideModule. See Glide Generated API docs for implementation.

Contributors ✨

Many thanks to these wonderful people (emoji key):

Alex Li
Alex Li

💻 🎨 📖 💡 🤔 🚧 💬 👀 ️️️️♿️ 🌍
Caijinglong
Caijinglong

💡 🤔
Marcel Schneider
Marcel Schneider

🐛 💻 🤔
ganlanshu0211
ganlanshu0211

🐛 🤔
JasonHezz
JasonHezz

🐛 💻
Yaniv Shaked
Yaniv Shaked

🌍 💻 🐛 🚧
avi-yadav
avi-yadav

💻
Letalus
Letalus

🐛 🌍
greymag
greymag

🌍
Nickolay Savchenko
Nickolay Savchenko

🎨
Kosuke Saigusa
Kosuke Saigusa

🌍
三闻书店
三闻书店

📖
DidiosFaust
DidiosFaust

🌍
xiejie
xiejie

🐛
Ahmed Masoud
Ahmed Masoud

🌍
luomo-pro
luomo-pro

️️️️♿️ 🐛
paigupai
paigupai

🌍
Muhammad Taqi Abdul Aziz
Muhammad Taqi Abdul Aziz

📖
何锦余
何锦余

🐛
Leon Dudlik
Leon Dudlik

🐛
Maël
Maël

💻 🚧
dddrop
dddrop

💻
Nguyen Phuc Loi
Nguyen Phuc Loi

🌍
Cevheri
Cevheri

🌍
mirimhee
mirimhee

🌍
Amos
Amos

🐛

This project follows the all-contributors specification. Contributions of any kind welcomed!!

Credits

Every aspect of IntelliJ IDEA has been designed to maximize developer productivity. Together, intelligent coding assistance and ergonomic design make development not only productive but also enjoyable.

Thanks to JetBrains for allocating free open-source licenses for IDEs such as IntelliJ IDEA.

flutter_wechat_assets_picker's People

Contributors

alexv525 avatar allcontributors[bot] avatar amoshuke avatar avi-yadav avatar caijinglong avatar cevheri avatar conanxie avatar dddrop avatar greymag avatar jasonhezz avatar jon-millent avatar kosukesaigusa avatar legoffmael avatar leonpesdk avatar letalus avatar limmihee avatar maxzod avatar naiksoftware avatar nploi avatar paigupai avatar schnmar avatar taqiabdulaziz avatar yanivshaked avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter_wechat_assets_picker's Issues

[BUG] The previews in the widget of pick image is black

Describe the bug (描述)
The previews in the widget of pick image is black

How to reproduce (如何复现)
Normal use, no special.

final List<AssetEntity> result = await AssetPicker.pickAssets(
        context, selectedAssets: lstTmp,
        maxAssets: widget.maxCount,
        requestType: RequestType.image);

ios.jpg
image url:
https://postimg.cc/n9CrdmKV

Device information (设备信息)

  • Device: iPhoneSE
  • OS: 13.6
  • Flutter Version: v1.17.0

Left Padding on Cancel button - iOS

the cancel button has no padding against the edge of the screen in the latest build on iOS. The Preview button at the bottom of the screen is correct, and the same padding should be applied to the cancel button

[Feature] custom usage as a widget

Dear Alex,

Describe the solution you'd like (描述你期望的解决方案)
I would like to use the assets_picker to develop a custom application behaviour(similar to instagram-share-behaviour).
First, I want to show the asset picker using a Navigator.of(context, rootNavigator: true).push. When the user presses the confirmation button on the top right side I want to push a follow up page on which a user can edit a post by adding some text and some additional information and remove assets from the current asset selection.
On top of that, I want to be able to use the back chevron of Navigator to return to the assets_picker using the typical Navigator back behaviour and not by doing another Navigator.of(context, rootNavigator: true).push.

Describe alternatives you've considered (其他解决方案或疑虑)
I've considered extracting some logic of AssetPicker, but I keep running in to errors.

Solution proposal
Provide a way to use the assets_picker as a widget additionally to the already implemented push-behaviour.

Can you please help me out on this?

If you need additional information, please let me know.
Thank you!

IOS HEIC HEIF 图片格式问题

在IOS手机上,手机自带相机拍摄出来的图片都是 heic 和 heif 格式的,在相册中无法显示 ,
PS:这个格式其实挺恶心的flutter 上目前没有图片组件能够直接显示需要转换成流才能给控件显示
2921586421986_ pic

Confirm button text color cannot be modified

Describe the bug (描述)
My theme color is yellow. But the font color of the confirmation button is white. Humble. Hope to be able to customize the button font color

Expected behavior (期望行为)
Ability to customize button font color

[Feature] 希望扩展 SortPathDelegate,能够让用户传入

希望能够提供这个扩展,因为项目中,iOS 测试人员觉得默认进去是“实况图片”或者叫“Live Photo” 很奇怪,而在Android 默认是Recent,这也很奇怪,为什么没有多语言?Download也不是中文的。希望提供入口,包括特定文件夹的多语言,还有排序的委托。谢谢您,祝您开发顺利

添加与微信朋友圈完全相同的模式

现在照片和视频可以混合显示,但是有时候会有一个需求选择了图片就不能选择视频,选择视频就不能选择图片,类似微信发朋友圈的时候选择照片 视频就灰掉了无法选择那样

更新 Flutter 1.17.0 后无法编译

经查:
是 extended_image_slide_page_route.dart 中下图方法缺少参数:
image

下图是 Flutter 1.17.0 的代码
image

希望作者尽快升级 extended_image 至最新版

PS:另外打开相册确实非常卡,,非常非常卡。。。不知可有什么优化没,iOS&Andorid

[BUG] 安装报错 Android embedding v2

Describe the bug (描述)

Running "flutter pub get" in byapp... 1.2s
The plugin assets_audio_player requires your app to be migrated to the Android embedding v2. Follow the steps on https://flutter.dev/go/android-project-migration and re-run this command.
exit code 1

Device information (设备信息)
• Flutter version 1.17.3
• Framework revision b041144f83 (2 weeks ago), 2020-06-04 09:26:11 -0700
• Engine revision ee76268252
• Dart version 2.8.4

Additional context (附加信息)
Add any other context about the problem here. 在此提供更多的内容。

Error when clicking on back button after detail view of a picture is opened

When I open a picture in detail view in the AssetPicker and press the back button the following error is thrown:

[VERBOSE-2:ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The getter 'currentlySelectedAssets' was called on null. Receiver: null Tried calling: currentlySelectedAssets #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5) #1 AssetPickerViewerState.syncSelectedAssetsWhenPop (package:wechat_assets_picker/src/widget/asset_picker_viewer.dart:235:55) #2 ModalRoute.willPop (package:flutter/src/widgets/routes.dart:1263:26) #3 NavigatorState.maybePop (package:flutter/src/widgets/navigator.dart:3536:67) #4 Navigator.maybePop (package:flutter/src/widgets/navigator.dart:1960:34) #5 BackButton.build.<anonymous closure> (package:flutter/src/material/back_button.dart:108:21) #6 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:779:19) #7 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:862:36) #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24) <…>

Please let me know, if you need additional information. I'm working with the current beta channel version of Flutter.

[BUG] ACCESS_MEDIA_LOCATION权限问题

请问如果拒绝ACCESS_MEDIA_LOCATION权限,图片预览不成功,这个权限是android10必须要申请的么?
因为混合编译后,在预览图片界面,点击图片后,申请权限弹框即使允许权限,图片也会预览失败。

[Error] Glide `FileNotFoundException`

Describe the bug (描述)
A clear and concise description of what the bug is. 请用精炼的语句准确描述你遇到的BUG。

How to reproduce (如何复现)
Please provide a minimum demo rather than a full project or a incomplete pages. Otherwise we have rights to reject your request.

请提供一个最小化的demo用于复现,而不要提供整个项目或者不完整的页面,否则我们有权拒绝你的请求。

Steps to reproduce the behavior (描述复现步骤):

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior (期望行为)
A clear and concise description of what you expected to happen.

Screenshots (If contains) (是否有截图可以提供)
If applicable, add screenshots to help explain your problem.

Device information (设备信息)

  • Device: 努比亚x
  • OS: Android 8.1.0
  • Package Version: 4.0.0
  • Flutter Version: [e.g. v1.17.1]

Additional context (附加信息)
Add any other context about the problem here. 在此提供更多的内容。

class HomePage extends StatelessWidget {
   selectImage(){
    final List<AssetEntity> assets = await AssetPicker.pickAssets(context);
   } 
}

错误的文件路径: wechat_assets_picker-4.0.0/lib/src/provider/asset_entity_image_provider.dart

image

[Feature Request] Preselect Recent in pathEntityList or make it configurable

Hey Alex,

this is more of a feature request than a bug. Currently the first item of pathEntityList is selected when the assets_picker is presented. In the simulator this makes sense, but in the real world, the first items are SloMo or Screenshots in my case. Most of the time people like to select recently taken pictures in such an asset picker, so from my point of view a preselection of Recent or a possibility to make it configurable would be great. What do you think?

Thank you
Marcel

[BUG] Demo crash when take a photo in IOS

Describe the bug (描述)
After click pick from camera, app will crash in IOS.

How to reproduce (如何复现)
Please provide a minimum demo rather than a full project or a incomplete pages. Otherwise we have rights to reject your request.
Project example

Steps to reproduce the behavior (描述复现步骤):

  1. Go to homepage
  2. Click on 'Pick from camera'
  3. See error

Expected behavior (期望行为)
No crash and take a photo

Screenshots (If contains) (是否有截图可以提供)
If applicable, add screenshots to help explain your problem.

Device information (设备信息)

  • Device: iPhone X
  • OS: IOS 13.5.1
  • Package Version: 4.1.0+2
  • Flutter Version: 1.20.0-7.2.pre

Additional context (附加信息)
stacktrace
[access] This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

Workaround:
Add following content to info.plist.

<key>NSCameraUsageDescription</key>
<string>Take a photo for display</string>

[BUG] Navigation bar's color unable to restored after the picker was dismissed

Describe the bug (描述)
BottomNavigationBar color was changed after picker closed
How to reproduce (如何复现)
close picker

Steps to reproduce the behavior (描述复现步骤):

close picker

Expected behavior (期望行为)

Screenshots (If contains) (是否有截图可以提供)
If applicable, add screenshots to help explain your problem.

Device information (设备信息)

  • Device: Android

Additional context (附加信息)
Add any other context about the problem here. 在此提供更多的内容。

[BUG] Elevation Parameter has no effect

Describe the bug (描述)
I'm using the following code:

appBarTheme: const AppBarTheme(
                brightness: Brightness.light,
                elevation: 100.0,
)

on AssetPicker initialization.

But it doesn't seem to have an effect. There is still no effect displayed. Can you have a look into this? I couldn't really find a solution as you are using your own fixedAppBar implementation.

What I tried:

Changing the color of the Box Shadow: This works, but its not the elevation effect, but just an "overall" shadow on the AppBar:
Simulator-Screen-Shot-i-Phone-11-Pro-2020-05-31-at-17-46-25

My expectation:

Having some parameters or the possibility to pass my own appbar to make it look like this:
Ohne-Titel

Thank you Andrew, you are the best! Let me know if you need additional information.

Cheers,
Marcel

[BUG] ios icloud

Describe the bug (描述)
ios icloud视频无法播放,图片显示慢

How to reproduce (如何复现)
手机里有大量图片,有未下载的icloud视频

Expected behavior (期望行为)
正常显示

Device information (设备信息)

  • Device: [ iPhone xs max]
  • OS: [e.g. iOS13.4.1]
  • Package Version: [lasted]
  • Flutter Version: [ v1.17.1]

[Contributors] Add your contributions.

Contributions are welcome for everyone who wants to improve this package. For who has already contribute to the package, you can add your contributions if you wish.

Flutter-Desktop (MacOS) Support

Are there any plans to enable support for Desktop? I have this successfully implemented on ios and android, but I am currently seeing the following error, despite having the permissions/capabilities in my entitlements folders:

flutter: [FilePicker] Unsupported operation. Method not found. The exception thrown was: MissingPluginException(No implementation found for method ANY on channel miguelruivo.flutter.plugins.filepicker)
flutter: ****** EXCEPTION
flutter: No implementation found for method ANY on channel miguelruivo.flutter.plugins.filepicker

[BUG] using pickerTheme argument always causes error

Describe the bug (描述)
Using a customPickerTheme as an argument always causes an error "'Theme and theme color cannot be set at the same time.'"

How to reproduce (如何复现)
This is caused as the optional parameter themeColor has a standard value of C.themeColor when no value is passed as an argument. You have to explicitly set themeColor to null to use a customPickerTheme.

Expected behavior (期望行为)
Using customPickerTheme without having to explicitly set themeColor to null is possible.

[Feature] Expose `FilterOption`

According to the feedback from some developers, the FilterOption can be exposed to the user end in order to provide more customize condition for selection. Such as only allow users to select videos below 1 minutes.

/cc @ganlanshu0211

[Feature] Take picture with Camera in list image picker

Version information (版本信息)

  • Device: e.g. iPhone6
  • OS: e.g. iOS 13.4
  • Package Version: e.g. v2.1.0
  • Flutter Version: e.g. v1.17.1

Is your feature request related to a problem? (功能是否与已有问题关联)
Capture camera.

Describe the solution you'd like (描述你期望的解决方案)
Capture camera when picker multi image, insert one more button on index 0 of list image picker!

Describe alternatives you've considered (其他解决方案或疑虑)
A clear and concise description of any alternative solutions or features you've considered.

Additional context (附加内容)
Add any other context or screenshots about the feature request here.

[Feature] 希望增加根据类型区分maxAssets

Version information (版本信息)

  • Device: e.g. iPhone6
  • OS: e.g. iOS 13.4
  • Package Version: e.g. v2.1.0
  • Flutter Version: e.g. v1.17.1

Describe the solution you'd like (描述你期望的解决方案)
比如:requestType 为RequestType.common时,希望如果用户选择视频只能选1个,但是选择图片的话就可以选择9个
Describe alternatives you've considered (其他解决方案或疑虑)
A clear and concise description of any alternative solutions or features you've considered.

Additional context (附加内容)
Add any other context or screenshots about the feature request here.

视频拉伸问题

视频预览的时候被强制全屏拉伸导致视频比例失调效果很差

TextDelegate的国际化问题

image
也许不能这样定义TextDelegate,因为项目中用到了国际化,而国际化取对应的key的语言用到了context。建议使用普通的class来处理,传入固定的构造参数即可

[BUG] Usage of assets_picker with CupertinoTabScaffold

Describe the bug (描述)
I'm trying to use the asset picker with a CupertinoTabScaffold. When displaying the asset picker the CupertinoTabBar is still displayed on top the asset picker and the buttons are not reachable.

How to reproduce (如何复现)
I can provide example code if needed, please let me know.

Expected behavior (期望行为)

That the assetPicker is a fullscreen dialogue and displayed above the CupertinoTabBar.

A way to pass an argument on what type of dialogue should be displayed or that the asset picker is displayed on top of Cupertino Tab Bar.

Screenshots (If contains) (是否有截图可以提供)

Simulator-Screen-Shot-i-Phone-11-Pro-2020-05-25-at-21-55-03

Device information (设备信息)

  • Device: Simulator iPhone 11 pro
  • OS: iOS 13.5
  • Package Version: 2.0.1
  • Flutter Version: 1.17.1

Thank you very much for your help!

开issue前必读 (Read before create a new issue)

Knowing issues that will not fix


Issues let users and developers be able to feedback their problem in usage, their request for features, their confusion about the source code and classes, rather than the place to make argument, say bad words, ask for a non-sense help, or bring up some off-topic words.
So before you submit new issues, please think twice that if it's really necessary to do it, or just go check the documentation or the example more carefully.

Here're the things banned from the repository:

  • Not following the issue template. (including delete all content in the template, close immediately with invalid label)
  • Ask a question which has a clear explanation in document. (close immediately with i: read document label)
  • Ask a question which is not related to the package or it's dependencies. (close immediately with invalid (maybe stackoverflow) label)
  • 'reap without sowing' (close immediately with wontfix label)
  • Insulting anyone (ban & lock & close permanently)
  • (more to add...)

国内用户请注意

如果不是严重问题,可以加入 QQ群:181398081(请正确回答问题) 后,提供必要的信息进行提问。
如果你坚持要开 issue,请 尽量使用英文,因为 GitHub 为国际开源社区,你提的问题很有可能国际友人也有经历。如果你认为仅用英语表达不够完善,可以使用双语补充
Issue 区是用来反馈使用问题、请求新功能实现、源码讨论的地方,不是用来进行无谓的争吵、爆粗、问无关问题、白嫖的地方。所以在提交新的 issue 前,请三思,如果三思后认为仍然需要开 issue,请继续你的行动,否则请出门左转文档区。

以下内容将直接处理:

  • 不使用 issue 模板创建 issue、或使用了模板但是没有依照模板内容创建(立刻被关闭并打上 invalid 标签)
  • 问一个文档里已明确说明的问题(立刻被关闭并打上 i: read document 标签)
  • 问与该组件无关的问题(立刻被关闭并打上 invalid(也可能是 stackoverflow )标签)
  • 想白嫖(立刻被关闭并打上 wontfix 标签)
  • 侮辱任何人(立刻被 永久屏蔽 & 锁定 & 关闭
  • (更多暂时想不起来的事)

933637000BD236B04928636CD26F8511

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.