Skip to content

Commit c7cfb6a

Browse files
committed
📝 Add description for displaying selected assets.
1 parent a2ddb96 commit c7cfb6a

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

README-ZH.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Language: [English](README.md) | 中文简体
2929
* [使用方法](#使用方法-)
3030
* [简单的使用方法](#简单的使用方法)
3131
* [完整参数的使用方法](#完整参数的使用方法)
32+
* [展示选中的资源](#展示选中的资源)
3233
* [注册资源变化回调](#注册资源变化回调)
3334
* [类介绍](#类介绍-)
3435
* [`AssetEntity`](#assetentity)
@@ -179,6 +180,16 @@ AssetPicker.pickAsset(context).then((List<AssetEntity> assets) {
179180

180181
欲了解各种选择器模式,请直接运行 example 查看。
181182

183+
### 展示选中的资源
184+
185+
`AssetEntityImageProvider` 可以为 **图片 & 视频** 展示缩略图,以及展示 **图片的原图**。它的使用方法与常见的 `ImageProvider` 一致。
186+
187+
```dart
188+
Image(image: AssetEntityImageProvider(asset, isOriginal: false))
189+
```
190+
191+
请查看示例以了解它如何进行展示。
192+
182193
### 注册资源变化回调
183194
```dart
184195
AssetPicker.registerObserve(); // 注册回调

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ This project follows the [all-contributors](https://github.com/all-contributors/
5050
* [Usage](#usage-)
5151
* [Simple usage](#simple-usage)
5252
* [Complete param usage](#complete-param-usage)
53+
* [Display selected assets](#display-selected-assets)
5354
* [Register assets change observe callback](#register-assets-change-observe-callback)
5455
* [Classes Introduction](#classes-introduction-)
5556
* [`AssetEntity`](#assetentity)
@@ -89,7 +90,7 @@ See [Migration Guide](doc/migration_guide.md).
8990

9091
## READ THIS FIRST ‼️
9192

92-
Althought the package provide selection for assets, it still require users build their own methods to handle display/upload, etc. If you have any question about how to build it, please run the example or refer to [photo_manager](https://github.com/CaiJingLong/flutter_photo_manager) for API usage.
93+
Althought the package provide selection for assets, it still require users build their own methods to handle upload, image compress, etc. If you have any question about how to build it, please run the example or refer to [photo_manager](https://github.com/CaiJingLong/flutter_photo_manager) for API usage.
9394

9495
## Preparing for use 🍭
9596

@@ -200,6 +201,16 @@ AssetPicker.pickAsset(context).then((List<AssetEntity> assets) {
200201

201202
For various type of the picker, head over to the example and run it with no doubt.
202203

204+
### Display selected assets
205+
206+
The `AssetEntityImageProvider` can display the thumb image of _images & videos_, and the original data of _image_. Use it like a common `ImageProvider`.
207+
208+
```dart
209+
Image(image: AssetEntityImageProvider(asset, isOriginal: false))
210+
```
211+
212+
Check the example for how it displays.
213+
203214
### Register assets change observe callback
204215
```dart
205216
AssetPicker.registerObserve(); // Register callback.

0 commit comments

Comments
 (0)