wechat_assets_picker 1.1.0 copy "wechat_assets_picker: ^1.1.0" to clipboard
wechat_assets_picker: ^1.1.0 copied to clipboard

outdated

An assets picker in pure dart which looks like the one in WeChat, support multi asset pick from device.

Flutter WeChat Assets Picker #

pub package GitHub stars GitHub forks GitHub license FlutterCandies

Language: English | 中文简体

An assets picker which looks like the one in WeChat, based on photo_manager for asset implementation, extended_image for image preview, provider to help controlling the state of the picker.

Features ✨ #

  • 💚 99% simillar to WeChat style.
  • 🌠 Support multi assets pick.
  • 🔍 Support asset preview.

Screenshots 📸 #

1.png2.png3.png

TODO 📅 #

  • Image asset support
    • Image editing (Cut/Rotate/Draw)
  • Video asset support
    • Video editing support
  • Single asset mode
  • i18n support
  • Custom text delegate support
  • Flutter For the Web support

Preparing for use 🍭 #

Flutter #

Add wechat_assets_picker to pubspec.yaml dependencies.

dependencies:
  wechat_assets_picker: $latest_version

Then import the package in your code:

import 'package:wechat_assets_picker/wechat_assets_picker.dart';

Android #

You need at lease three permissions: INTERNET READ_EXTERNAL_STORAGE WRITE_EXTERNAL_STORAGE.

iOS #

Add following content to info.plist.

<key>NSAppTransportSecurity</key>
<dict>
	<key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>
<key>NSPhotoLibraryUsageDescription</key>
<string>Replace with your permission description.</string>

Usage 📖 #

Name Type Description Default
context BuildContext Context for navigator push. null
maxAssets int Maximum asset that the picker can pick. 9
pageThumbSize int The size of thumb data in picker. 80
gridCount int Grid count in picker. 4
requestType RequestType Request type for picker. RequestType.image
selectedAssets Set<AssetEntity> Selected assets. Using Set to prevent dulplicate selection. null
themeColor Color Main theme color for the picker Color(0xff00bc56)

Simple usage #

final Set<AssetEntity> assets = await AssetPicker.pickAssets(context);

or

AssetPicker.pickAsset(context).then((Set<AssetEntity> assets) {
  /.../
});

Complete param usage #

Set<AssetEntity> assets = <AssetEntity>{};

final Set<AssetEntity> result = await AssetPicker.pickAssets(
  context,
  maxAssets: 9,
  pageThumbSize: 80,
  gridCount: 4,
  requestType: RequestType.image,
  selectedAssets: assets,
  themeColor: Colors.cyan,
);

or

Set<AssetEntity> assets = <AssetEntity>{};

AssetPicker.pickAssets(
  context,
  maxAssets: 9,
  pageThumbSize: 80,
  gridCount: 4,
  requestType: RequestType.image,
  selectedAssets: assets,
  themeColor: Colors.cyan,
).then((Set<AssetEntity> assets) {
  /.../
});
667
likes
0
pub points
98%
popularity

Publisher

verified publisherfluttercandies.com

An assets picker in pure dart which looks like the one in WeChat, support multi asset pick from device.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

extended_image, flutter, photo_manager, provider, video_player

More

Packages that depend on wechat_assets_picker