Skip to content

Commit c6a75da

Browse files
committed
📝 Fill up doc with delegate support description.
1 parent 8d1029c commit c6a75da

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

README-ZH.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Language: [English](README.md) | 中文简体
3333
* [完整参数的使用方法](#完整参数的使用方法)
3434
* [展示选中的资源](#展示选中的资源)
3535
* [注册资源变化回调](#注册资源变化回调)
36+
* [自定义类型或 UI](#自定义类型或-ui)
3637
* [类介绍](#类介绍-)
3738
* [`AssetEntity`](#assetentity)
3839
* [常见问题](#常见问题-)
@@ -48,9 +49,10 @@ Language: [English](README.md) | 中文简体
4849

4950
## 特性 ✨
5051

51-
- [x] 💚 99%的微信风格
52+
- [x] ♻️ 支持基于代理重载的全量自定义
53+
- [x] 💚 99% 的微信风格
5254
- [x] 📷 图片资源支持
53-
- [x] 🔬HEIC格式图片支持
55+
- [x] 🔬HEIC 格式图片支持
5456
- [x] 🎥 视频资源支持
5557
- [x] 🎶 音频资源支持
5658
- [x] 1️⃣ 单资源模式
@@ -193,13 +195,21 @@ Image(image: AssetEntityImageProvider(asset, isOriginal: false))
193195
请查看示例以了解它如何进行展示。
194196

195197
### 注册资源变化回调
198+
196199
```dart
197200
AssetPicker.registerObserve(); // 注册回调
198201
```
199202
```dart
200203
AssetPicker.unregisterObserve(); // 取消注册回调
201204
```
202205

206+
### Customize with your own type or UI
207+
208+
`AssetPickerBuilderDelegate``AssetPickerViewerBuilderDelegate``AssetPickerProvider`
209+
`AssetPickerViewerProvider` 均已暴露且可重载。使用者可以使用自定义的泛型类型 <A: 资源, P: 路径>,配合继承与
210+
重载,实现对应抽象类和类中的方法。更多用法请查看示例中的 `Custom` 页面,该页面实现了以 <File, Directory> 为
211+
类型基础的选择器。
212+
203213
## 类介绍 💭
204214

205215
### `AssetEntity`

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ This project follows the [all-contributors](https://github.com/all-contributors/
5454
* [Complete param usage](#complete-param-usage)
5555
* [Display selected assets](#display-selected-assets)
5656
* [Register assets change observe callback](#register-assets-change-observe-callback)
57+
* [Customize with your own type or UI](#customize-with-your-own-type-or-ui)
5758
* [Classes Introduction](#classes-introduction-)
5859
* [`AssetEntity`](#assetentity)
5960
* [Frequent asked question](#frequent-asked-question-)
@@ -69,6 +70,7 @@ See [Migration Guide](doc/migration_guide.md).
6970

7071
## Features ✨
7172

73+
- [x] ♻️ Fully implementable with delegate override.
7274
- [x] 💚 99% simillar to WeChat style.
7375
- [x] 📷 Image asset support
7476
- [x] 🔬HEIC/HEIF Image type support
@@ -214,13 +216,21 @@ Image(image: AssetEntityImageProvider(asset, isOriginal: false))
214216
Check the example for how it displays.
215217

216218
### Register assets change observe callback
219+
217220
```dart
218221
AssetPicker.registerObserve(); // Register callback.
219222
```
220223
```dart
221224
AssetPicker.unregisterObserve(); // Unregister callback.
222225
```
223226

227+
### Customize with your own type or UI
228+
229+
`AssetPickerBuilderDelegate`, `AssetPickerViewerBuilderDelegate`, `AssetPickerProvider` and
230+
`AssetPickerViewerProvider` are all exposed and overridable. You can extends them and use your own
231+
type with generic type <A: Asset, P: Path>, then implement abstract methods. See the `Custom` page
232+
in the example which implements a picker with <File, Directory>.
233+
224234
## Classes Introduction 💭
225235

226236
### `AssetEntity`

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: wechat_assets_picker
2-
description: An assets' picker written in pure Dart which looks like the one in WeChat, support multi asset pick from the device.
2+
description: An audio/video/image picker in pure Dart which is the same with WeChat, support multi picking.
33
version: 5.0.0-nullsafety.5
44
homepage: https://github.com/fluttercandies/flutter_wechat_assets_picker
55

0 commit comments

Comments
 (0)