Skip to content

Commit 2cba717

Browse files
authored
📝 Update documents (#265)
1 parent f927cbd commit 2cba717

File tree

4 files changed

+140
-81
lines changed

4 files changed

+140
-81
lines changed

README-ZH.md

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313

1414
Language: [English](README.md) | 中文
1515

16-
基于微信 UI 的 **资源选择器**,基于 `photo_manager` 实现资源相关功能,
17-
`extended_image` 用于查看图片,`provider` 用于协助管理选择器的状态。
16+
基于微信 UI 的 **资源选择器**
17+
基于 [`photo_manager`](https://pub.flutter-io.cn/packages/photo_manager) 实现资源相关功能,
18+
[`extended_image`](https://pub.flutter-io.cn/packages/extended_image) 用于查看图片,
19+
[`provider`](https://pub.flutter-io.cn/packages/provider) 用于协助管理选择器的状态。
1820

1921
需要拍照及录制视频,请查看示例的详细用法,
2022
并前往 [wechat_camera_picker](https://pub.flutter-io.cn/packages/wechat_camera_picker)
@@ -185,28 +187,28 @@ final AssetEntity? entity = await AssetPicker.pickAssets(
185187

186188
`AssetPickerConfig` 的成员说明:
187189

188-
| 参数名 | 类型 | 描述 | 默认值 |
189-
|---------------------------|------------------------------------|------------------------------------------------|-------------------------------------|
190-
| selectedAssets | `List<AssetEntity>?` | 已选的资源。确保不重复选择。如果你允许重复选择,请将其置空。 | `null` |
191-
| maxAssets | `int` | 最多选择的图片数量 | 9 |
192-
| pageSize | `int` | 分页加载时每页加载的资源数量。**必须为网格数的倍数。** 设置为`null`可以取消分页。 | 320 (80 * 4) |
193-
| gridThumbSize | `int` | 预览网格的缩略图大小 | 200 |
194-
| pathThumbSize | `int` | 路径选择器的缩略图大小 | 80 |
195-
| previewThumbSize | `List<int>?` | 预览时图片的缩略图大小 | `null` |
196-
| gridCount | `int` | 选择器网格数量 | 4 |
197-
| requestType | `RequestType` | 选择器选择资源的类型 | `RequestType.image` |
198-
| specialPickerType | `SpecialPickerType?` | 提供一些特殊的选择器类型以整合非常规的选择行为 | `null` |
199-
| themeColor | `Color?` | 选择器的主题色 | `Color(0xff00bc56)` |
200-
| pickerTheme | `ThemeData?` | 选择器的主题提供,包括查看器 | `null` |
201-
| sortPathDelegate | `SortPathDeleage?` | 资源路径的排序实现,可自定义路径排序方法 | `CommonSortPathDelegate` |
202-
| textDelegate | `DefaultAssetsPickerTextDelegate?` | 选择器的文本代理构建,用于自定义文本 | `DefaultAssetsPickerTextDelegate()` |
203-
| filterOptions | `FilterOptionGroup?` | 允许用户自定义资源过滤条件 | `null` |
204-
| specialItemBuilder | `SpecialItemBuilder?` | 自定义item的构造方法 | `null` |
205-
| specialItemPosition | `SpecialItemPosition` | 允许用户在选择器中添加一个自定义item,并指定位置。 | `SpecialPosition.none` |
206-
| loadingIndicatorBuilder | `IndicatorBuilder?` | 加载器的实现 | `null` |
207-
| selectPredicate | `AssetSelectPredicate` | 判断资源可否被选择 | `null` |
208-
| shouldRevertGrid | `bool?` | 判断资源网格是否需要倒序排列 | `null` |
209-
| pageRouteBuilder | `AssetPickerPageRouteBuilder` | 构建 `AssetPickerPageRoute` | `null` |
190+
| 参数名 | 类型 | 描述 | 默认值 |
191+
|-------------------------|--------------------------------------|-----------------------------|-----------------------------|
192+
| selectedAssets | `List<AssetEntity>?` | 已选的资源。确保不重复选择。 | `null` |
193+
| maxAssets | `int` | 最多选择的图片数量 | 9 |
194+
| pageSize | `int` | 分页加载时每页加载的资源数量。**必须为网格数的倍数。 | 80 |
195+
| gridThumbnailSize | `ThumbnailSize` | 预览网格的缩略图大小 | `ThumbnailSize.square(200)` |
196+
| pathThumbnailSize | `ThumbnailSize` | 路径选择器的缩略图大小 | `ThumbnailSize.square(80)` |
197+
| previewThumbnailSize | `ThumbnailSize?` | 预览时图片的缩略图大小 | `null` |
198+
| requestType | `RequestType` | 选择器选择资源的类型 | `RequestType.common` |
199+
| specialPickerType | `SpecialPickerType?` | 提供一些特殊的选择器类型以整合非常规的选择行为 | `null` |
200+
| keepScrollOffset | `bool` | 选择器是否可以从同样的位置开始选择 | `null` |
201+
| sortPathDelegate | `SortPathDelegate<AssetPathEntity>?` | 资源路径的排序实现,可自定义路径排序方法 | `CommonSortPathDelegate` |
202+
| filterOptions | `FilterOptionGroup?` | 允许用户自定义资源过滤条件 | `null` |
203+
| gridCount | `int` | 选择器网格数量 | 4 |
204+
| themeColor | `Color?` | 选择器的主题色 | `Color(0xff00bc56)` |
205+
| pickerTheme | `ThemeData?` | 选择器的主题提供,包括查看器 | `null` |
206+
| textDelegate | `AssetPickerTextDelegate?` | 选择器的文本代理构建,用于自定义文本 | `AssetPickerTextDelegate()` |
207+
| specialItemPosition | `SpecialItemPosition` | 允许用户在选择器中添加一个自定义item,并指定位置。 | `SpecialPosition.none` |
208+
| specialItemBuilder | `SpecialItemBuilder?` | 自定义item的构造方法 | `null` |
209+
| loadingIndicatorBuilder | `IndicatorBuilder?` | 加载器的实现 | `null` |
210+
| selectPredicate | `AssetSelectPredicate` | 判断资源可否被选择 | `null` |
211+
| shouldRevertGrid | `bool?` | 判断资源网格是否需要倒序排列 | `null` |
210212

211213
### 更详细的使用方法
212214

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
Language: English | [中文](README-ZH.md)
1515

1616
An **assets picker** which based on the WeChat's UI,
17-
using `photo_manager` for asset implementation,
18-
`extended_image` for image preview,
19-
and `provider` to help control the state of the picker.
17+
using [`photo_manager`](https://pub.dev/packages/photo_manager) for asset implementation,
18+
[`extended_image`](https://pub.dev/packages/extended_image) for image preview,
19+
and [`provider`](https://pub.dev/packages/provider) to help control the state of the picker.
2020

2121
To take a photo or a video for assets, please check the detailed usage in the example, and head over to
2222
[wechat_camera_picker](https://pub.dev/packages/wechat_camera_picker).
@@ -180,27 +180,28 @@ final AssetEntity? entity = await AssetPicker.pickAssets(
180180

181181
Fields in `AssetPickerConfig`:
182182

183-
| Name | Type | Description | Default |
184-
|---------------------------|-----------------------------|---------------------------------------------------------------------------------------------------------------------|-------------------------------------|
185-
| selectedAssets | `List<AssetEntity>?` | Selected assets. Prevent duplicate selection. If you don't need to prevent duplicate selection, just don't pass it. | `null` |
186-
| maxAssets | `int` | Maximum asset that the picker can pick. | 9 |
187-
| pageSize | `int?` | Number of assets per page. **Must be a multiple of `gridCount`**. | 320 (80 * 4) |
188-
| gridThumbSize | `int` | Thumbnail size for the grid's item. | 200 |
189-
| pathThumbSize | `int` | Thumbnail size for the path selector. | 80 |
190-
| previewThumbSize | `List<int>?` | Preview thumbnail size in the viewer. | `null` |
191-
| gridCount | `int` | Grid count in picker. | 4 |
192-
| requestType | `RequestType` | Request type for picker. | `RequestType.image` |
193-
| specialPickerType | `SpacialPickerType?` | Provides the option to integrate a custom picker type. | `null` |
194-
| themeColor | `Color?` | Main theme color for the picker. | `Color(0xff00bc56)` |
195-
| pickerTheme | `ThemeData?` | Theme data provider for the picker and the viewer. | `null` |
196-
| sortPathDelegate | `SortPathDeleage?` | Path entities sort delegate for the picker, sort paths as you want. | `CommonSortPathDelegate` |
197-
| textDelegate | `AssetsPickerTextDelegate?` | Text delegate for the picker, for customize the texts. | `DefaultAssetsPickerTextDelegate()` |
198-
| filterOptions | `FilterOptionGroup?` | Allow users to customize assets filter options. | `null` |
199-
| specialItemBuilder | `SpecialItemBuilder?` | The widget builder for the special item. | `null` |
200-
| specialItemPosition | `SpecialItemPosition` | Allow users set a special item in the picker with several positions. | `SpecialItemPosition.none` |
201-
| loadingIndicatorBuilder | `IndicatorBuilder?` | Indicates the loading status for the builder. | `null` |
202-
| selectPredicate | `AssetSelectPredicate` | Predicate whether an asset can be selected or unselected. | `null` |
203-
| shouldRevertGrid | `bool?` | Whether the assets grid should revert. | `null` |
183+
| Name | Type | Description | Default |
184+
|-------------------------|--------------------------------------|---------------------------------------------------------------------------|-----------------------------|
185+
| selectedAssets | `List<AssetEntity>?` | Selected assets. Prevent duplicate selection. | `null` |
186+
| maxAssets | `int` | Maximum asset that the picker can pick. | 9 |
187+
| pageSize | `int?` | Number of assets per page. **Must be a multiple of `gridCount`**. | 80 |
188+
| gridThumbnailSize | `ThumbnailSize` | Thumbnail size for the grid's item. | `ThumbnailSize.square(200)` |
189+
| pathThumbnailSize | `ThumbnailSize` | Thumbnail size for the path selector. | `ThumbnailSize.square(80)` |
190+
| previewThumbnailSize | `ThumbnailSize?` | Preview thumbnail size in the viewer. | `null` |
191+
| requestType | `RequestType` | Request type for picker. | `RequestType.common` |
192+
| specialPickerType | `SpacialPickerType?` | Provides the option to integrate a custom picker type. | `null` |
193+
| keepScrollOffset | `bool` | Whether the picker should save the scroll offset between pushes and pops. | `null` |
194+
| sortPathDelegate | `SortPathDelegate<AssetPathEntity>?` | Path entities sort delegate for the picker, sort paths as you want. | `CommonSortPathDelegate` |
195+
| filterOptions | `FilterOptionGroup?` | Allow users to customize assets filter options. | `null` |
196+
| gridCount | `int` | Grid count in picker. | 4 |
197+
| themeColor | `Color?` | Main theme color for the picker. | `Color(0xff00bc56)` |
198+
| pickerTheme | `ThemeData?` | Theme data provider for the picker and the viewer. | `null` |
199+
| textDelegate | `AssetPickerTextDelegate?` | Text delegate for the picker, for customize the texts. | `AssetPickerTextDelegate()` |
200+
| specialItemPosition | `SpecialItemPosition` | Allow users set a special item in the picker with several positions. | `SpecialItemPosition.none` |
201+
| specialItemBuilder | `SpecialItemBuilder?` | The widget builder for the special item. | `null` |
202+
| loadingIndicatorBuilder | `IndicatorBuilder?` | Indicates the loading status for the builder. | `null` |
203+
| selectPredicate | `AssetSelectPredicate` | Predicate whether an asset can be selected or unselected. | `null` |
204+
| shouldRevertGrid | `bool?` | Whether the assets grid should revert. | `null` |
204205

205206
### Detailed usage
206207

0 commit comments

Comments
 (0)