Skip to content

Commit f7f5c59

Browse files
committed
📝 Update docs for previewThumbSize.
1 parent 7bca2c2 commit f7f5c59

File tree

2 files changed

+48
-134
lines changed

2 files changed

+48
-134
lines changed

README-ZH.md

Lines changed: 24 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Flutter仿微信资源选择器
22

3-
[![pub package](https://img.shields.io/pub/v/wechat_assets_picker?color=42a012&label=%E7%A8%B3%E5%AE%9A%E7%89%88&logo=dart&style=flat-square)](https://pub.dev/packages/wechat_assets_picker)
4-
[![pub package](https://img.shields.io/pub/v/wechat_assets_picker?color=42a012&include_prereleases&label=%E5%BC%80%E5%8F%91%E7%89%88&logo=dart&style=flat-square)](https://pub.dev/packages/wechat_assets_picker)
3+
[![pub package](https://img.shields.io/pub/v/wechat_assets_picker?color=42a012&label=%E7%A8%B3%E5%AE%9A%E7%89%88&logo=dart&style=flat-square)](https://pub.flutter-io.cn/packages/wechat_assets_picker)
4+
[![pub package](https://img.shields.io/pub/v/wechat_assets_picker?color=42a012&include_prereleases&label=%E5%BC%80%E5%8F%91%E7%89%88&logo=dart&style=flat-square)](https://pub.flutter-io.cn/packages/wechat_assets_picker)
55
[![GitHub stars](https://img.shields.io/github/stars/fluttercandies/flutter_wechat_assets_picker?logo=github&style=flat-square)](https://github.com/fluttercandies/flutter_wechat_assets_picker/stargazers)
66
[![GitHub forks](https://img.shields.io/github/forks/fluttercandies/flutter_wechat_assets_picker?logo=github&style=flat-square)](https://github.com/fluttercandies/flutter_wechat_assets_picker/network)
77
[![Build status](https://img.shields.io/github/workflow/status/fluttercandies/flutter_wechat_assets_picker/Build%20test?label=%E7%8A%B6%E6%80%81&logo=github&style=flat-square)](https://github.com/fluttercandies/flutter_wechat_assets_picker/actions?query=workflow%3A%22Build+test%22)
@@ -13,7 +13,7 @@ Language: [English](README.md) | 中文简体
1313

1414
对标微信的**资源选择器**,基于`photo_manager`实现资源相关功能,`extended_image`用于查看图片,`provider`用于协助管理选择器的状态。
1515

16-
拍照及录制视频,请查看 example 详细用法,并前往 [wechat_camera_picker](https://pub.flutter-io.cn/packages/wechat_camera_picker)
16+
拍照及录制视频,请查看 example 详细用法,并前往 [wechat_camera_picker](https://fluttercandies.github.io/flutter_wechat_camera_picker/README-ZH.html)
1717

1818
## 目录 🗂
1919

@@ -80,9 +80,9 @@ dependencies:
8080
wechat_assets_picker: ^latest_version
8181
```
8282
83-
最新的**稳定**版本是: [![pub package](https://img.shields.io/pub/v/wechat_assets_picker?logo=dart&label=stable&style=flat-square)](https://pub.dev/packages/wechat_assets_picker)
83+
最新的**稳定**版本是: [![pub package](https://img.shields.io/pub/v/wechat_assets_picker?logo=dart&label=stable&style=flat-square)](https://pub.flutter-io.cn/packages/wechat_assets_picker)
8484
85-
最新的**开发**版本是: [![pub package](https://img.shields.io/pub/v/wechat_assets_picker?color=42a012&include_prereleases&label=dev&logo=dart&style=flat-square)](https://pub.dev/packages/wechat_assets_picker)
85+
最新的**开发**版本是: [![pub package](https://img.shields.io/pub/v/wechat_assets_picker?color=42a012&include_prereleases&label=dev&logo=dart&style=flat-square)](https://pub.flutter-io.cn/packages/wechat_assets_picker)
8686
8787
在你的代码中导入:
8888
@@ -96,49 +96,7 @@ import 'package:wechat_assets_picker/wechat_assets_picker.dart';
9696

9797
需要声明的权限:`INTERNET`, `READ_EXTERNAL_STORAGE`, `WRITE_EXTERNAL_STORAGE`, `ACCESS_MEDIA_LOCATION`
9898

99-
如果你发现有一些与`Glide`有关的警告日志输出,那么主项目就需要实现 `AppGlideModule`。比如:
100-
`example/android/app/build.gradle`:
101-
102-
```gradle
103-
apply plugin: 'com.android.application'
104-
apply plugin: 'kotlin-android'
105-
+ apply plugin: 'kotlin-kapt'
106-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
107-
108-
dependencies {
109-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
110-
+ implementation 'com.github.bumptech.glide:glide:4.11.0'
111-
+ kapt 'com.github.bumptech.glide:compiler:4.11.0'
112-
testImplementation 'junit:junit:4.12'
113-
}
114-
```
115-
116-
`example/android/app/src/main/kotlin/com/example/exampleapp/ExampleAppGlideModule.java`:
117-
```kotlin
118-
package com.example.exampleapp;
119-
120-
import com.bumptech.glide.annotation.GlideModule;
121-
import com.bumptech.glide.module.AppGlideModule;
122-
123-
@GlideModule
124-
public class ExampleAppGlideModule extends AppGlideModule {
125-
}
126-
```
127-
如果你使用了与该库不一样的`Glide`版本,请将以下内容添加到`build.gradle`
128-
```gradle
129-
rootProject.allprojects {
130-
subprojects {
131-
project.configurations.all {
132-
resolutionStrategy.eachDependency { details ->
133-
if (details.requested.group == 'com.github.bumptech.glide'
134-
&& details.requested.name.contains('glide')) {
135-
details.useVersion "4.11.0"
136-
}
137-
}
138-
}
139-
}
140-
}
141-
```
99+
如果你发现有一些与`Glide`有关的警告日志输出,那么主项目就需要实现 `AppGlideModule`。请查看 [Generated API](https://muyangmin.github.io/glide-docs-cn/doc/generatedapi.html).
142100

143101
### iOS
144102

@@ -161,25 +119,25 @@ platform :ios, '9.0'
161119

162120
## 使用方法 📖
163121

164-
| 参数名 | 类型 | 描述 | 默认值 |
165-
| -------------- | ------------------ | ------------------------------------------------ | ------------------- |
166-
| context | `BuildContext` | 用于路由的上下文 | `null` |
167-
| maxAssets | `int` | 最多选择的图片数量 | 9 |
168-
| pageSize | `int` | 分页加载时每页加载的资源数量。**必须为网格数的倍数。** 设置为`null`可以取消分页。 | 320 (80 * 4) |
169-
| pathThumbSize | `int` | 选择器的缩略图大小 | 80 |
170-
| gridCount | `int` | 选择器网格数量 | 4 |
171-
| requestType | `RequestType` | 选择器选择资源的类型 | `RequestType.image` |
172-
| specialPickerType | `SpecialPickerType` | 提供一些特殊的选择器类型以整合非常规的选择行为 | `null` |
173-
| selectedAssets | `List<AssetEntity>` | 已选的资源。确保不重复选择。如果你允许重复选择,请将其置空。 | `null` |
174-
| themeColor | `Color` | 选择器的主题色 | `Color(0xff00bc56)` |
175-
| pickerTheme | `ThemeData` | 选择器的主题提供,包括查看器 | `null` |
176-
| sortPathDelegate | `SortPathDeleage` | 资源路径的排序实现,可自定义路径排序方法 | `CommonSortPathDelegate` |
177-
| textDelegate | `TextDelegate` | 选择器的文本代理构建,用于自定义文本 | `DefaultTextDelegate()` |
178-
| filterOptions | `FilterOptionGroup` | Allow users to customize assets filter options. | `null` |
179-
| customItemBuilder | `WidgetBuilder` | 自定义item的构造方法 | `null` |
122+
| 参数名 | 类型 | 描述 | 默认值 |
123+
| ------------------ | -------------------- | ------------------------------------------------ | ------------------- |
124+
| maxAssets | `int` | 最多选择的图片数量 | 9 |
125+
| pageSize | `int` | 分页加载时每页加载的资源数量。**必须为网格数的倍数。** 设置为`null`可以取消分页。 | 320 (80 * 4) |
126+
| pathThumbSize | `int` | 选择器的缩略图大小 | 80 |
127+
| gridCount | `int` | 选择器网格数量 | 4 |
128+
| previewThumbSize | `List<int>` | 预览时图片的缩略图大小 | `null` |
129+
| requestType | `RequestType` | 选择器选择资源的类型 | `RequestType.image` |
130+
| specialPickerType | `SpecialPickerType` | 提供一些特殊的选择器类型以整合非常规的选择行为 | `null` |
131+
| selectedAssets | `List<AssetEntity>` | 已选的资源。确保不重复选择。如果你允许重复选择,请将其置空。 | `null` |
132+
| themeColor | `Color` | 选择器的主题色 | `Color(0xff00bc56)` |
133+
| pickerTheme | `ThemeData` | 选择器的主题提供,包括查看器 | `null` |
134+
| sortPathDelegate | `SortPathDeleage` | 资源路径的排序实现,可自定义路径排序方法 | `CommonSortPathDelegate` |
135+
| textDelegate | `TextDelegate` | 选择器的文本代理构建,用于自定义文本 | `DefaultTextDelegate()` |
136+
| filterOptions | `FilterOptionGroup` | Allow users to customize assets filter options. | `null` |
137+
| customItemBuilder | `WidgetBuilder` | 自定义item的构造方法 | `null` |
180138
| customItemPosition | `CustomItemPosition` | 允许用户在选择器中添加一个自定义item,并指定位置。 | `CustomItemPosition.none` |
181-
| routeCurve | `Curve` | 选择构造路由动画的曲线 | `Curves.easeIn` |
182-
| routeDuration | `Duration` | 选择构造路由动画的时间 | `const Duration(milliseconds: 500)` |
139+
| routeCurve | `Curve` | 选择构造路由动画的曲线 | `Curves.easeIn` |
140+
| routeDuration | `Duration` | 选择构造路由动画的时间 | `const Duration(milliseconds: 500)` |
183141

184142
### 简单的使用方法
185143

README.md

Lines changed: 24 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Language: English | [中文简体](README-ZH.md)
1313

1414
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.
1515

16-
To take a photo or a video for assets, please check the detailed usage in the example, and head over to [wechat_camera_picker](https://pub.dev/packages/wechat_camera_picker) .
16+
To take a photo or a video for assets, please check the detailed usage in the example, and head over to [wechat_camera_picker](https://fluttercandies.github.io/flutter_wechat_camera_picker/) .
1717

1818
## Contributors ✨
1919

@@ -111,54 +111,10 @@ import 'package:wechat_assets_picker/wechat_assets_picker.dart';
111111

112112
### Android
113113

114-
Package required you upgrade your flutter project's Android part to v2 embedding, for further information, check [Upgrading pre 1.12 Android projects](https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects)
115-
116114
Required permissions: `INTERNET`, `READ_EXTERNAL_STORAGE`, `WRITE_EXTERNAL_STORAGE`, `ACCESS_MEDIA_LOCATION`.
117115

118-
If you found some warning logs with `Glide` appearing, then the main project needs an implementation of `AppGlideModule`. For example:
119-
`example/android/app/build.gradle`:
120-
121-
```gradle
122-
apply plugin: 'com.android.application'
123-
apply plugin: 'kotlin-android'
124-
+ apply plugin: 'kotlin-kapt'
125-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
126-
127-
dependencies {
128-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
129-
+ implementation 'com.github.bumptech.glide:glide:4.11.0'
130-
+ kapt 'com.github.bumptech.glide:compiler:4.11.0'
131-
testImplementation 'junit:junit:4.12'
132-
}
133-
```
134-
135-
`example/android/app/src/main/kotlin/com/example/exampleapp/ExampleAppGlideModule.java`:
136-
137-
```kotlin
138-
package com.example.exampleapp;
139-
140-
import com.bumptech.glide.annotation.GlideModule;
141-
import com.bumptech.glide.module.AppGlideModule;
142-
143-
@GlideModule
144-
public class ExampleAppGlideModule extends AppGlideModule {
145-
}
146-
```
147-
If you're using different versions of `Glide`, please add this to the `build.gradle`:
148-
```gradle
149-
rootProject.allprojects {
150-
subprojects {
151-
project.configurations.all {
152-
resolutionStrategy.eachDependency { details ->
153-
if (details.requested.group == 'com.github.bumptech.glide'
154-
&& details.requested.name.contains('glide')) {
155-
details.useVersion "4.11.0"
156-
}
157-
}
158-
}
159-
}
160-
}
161-
```
116+
If you found some warning logs with `Glide` appearing, then the main project needs an implementation of `AppGlideModule`.
117+
See [Generated API](http://sjudd.github.io/glide/doc/generatedapi.html).
162118

163119
### iOS
164120

@@ -172,34 +128,34 @@ Add following content to `info.plist`.
172128
```
173129
<key>NSAppTransportSecurity</key>
174130
<dict>
175-
<key>NSAllowsArbitraryLoads</key>
176-
<true/>
131+
<key>NSAllowsArbitraryLoads</key>
132+
<true/>
177133
</dict>
178134
<key>NSPhotoLibraryUsageDescription</key>
179135
<string>Replace with your permission description.</string>
180136
```
181137

182138
## Usage 📖
183139

184-
| Name | Type | Description | Default |
185-
| -------------- | ------------------- | ------------------------------------------------------------ | ----------------------------------- |
186-
| context | `BuildContext` | Context for navigator push. | `null` |
187-
| maxAssets | `int` | Maximum asset that the picker can pick. | 9 |
188-
| pageSize | `int` | Assets amount when assets loaded with paging. **Must be a multiple of `gridCount`.** Nullable for non paging. | 320 (80 * 4) |
189-
| pathThumbSize | `int` | The size of thumb data in picker. | 80 |
190-
| gridCount | `int` | Grid count in picker. | 4 |
191-
| requestType | `RequestType` | Request type for picker. | `RequestType.image` |
192-
| specialPickerType | `SpacialPickerType` | Provide some special picker types to integrate un-common pick pattern. | `null` |
193-
| selectedAssets | `List<AssetEntity>` | Selected assets. Prevent duplicate selection. If you don't need to prevent duplicate selection, just don't pass it. | `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 | `TextDelegate` | Text delegate for the picker, for customize the texts. | `DefaultTextDelegate()` |
198-
| filterOptions | `FilterOptionGroup` | Allow users to customize assets filter options. | `null` |
199-
| customItemBuilder | `WidgetBuilder` | The widget builder for the custom item. | `null` |
200-
| customItemPosition | `CustomItemPosition` | Allow users set custom item in the picker with several positions. | `CustomItemPosition.none` |
201-
| routeCurve | `Curve` | The curve which the picker use to build page route transition. | `Curves.easeIn` |
202-
| routeDuration | `Duration` | The duration which the picker use to build page route transition. | `const Duration(milliseconds: 500)` |
140+
| Name | Type | Description | Default |
141+
| ------------------ | -------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
142+
| maxAssets | `int` | Maximum asset that the picker can pick. | 9 |
143+
| pageSize | `int` | Assets amount when assets loaded with paging. **Must be a multiple of `gridCount`.** Nullable for non paging. | 320 (80 * 4) |
144+
| pathThumbSize | `int` | The size of thumb data in picker. | 80 |
145+
| gridCount | `int` | Grid count in picker. | 4 |
146+
| previewThumbSize | `List<int>` | Thumb size for the preview of images in the viewer. | `null` |
147+
| requestType | `RequestType` | Request type for picker. | `RequestType.image` |
148+
| specialPickerType | `SpacialPickerType` | Provide some special picker types to integrate un-common pick pattern. | `null` |
149+
| selectedAssets | `List<AssetEntity>` | Selected assets. Prevent duplicate selection. If you don't need to prevent duplicate selection, just don't pass it. | `null` |
150+
| themeColor | `Color` | Main theme color for the picker | `Color(0xff00bc56)` |
151+
| pickerTheme | `ThemeData` | Theme data provider for the picker and the viewer. | `null` |
152+
| sortPathDelegate | `SortPathDeleage` | Path entities sort delegate for the picker, sort paths as you want. | `CommonSortPathDelegate` |
153+
| textDelegate | `TextDelegate` | Text delegate for the picker, for customize the texts. | `DefaultTextDelegate()` |
154+
| filterOptions | `FilterOptionGroup` | Allow users to customize assets filter options. | `null` |
155+
| customItemBuilder | `WidgetBuilder` | The widget builder for the custom item. | `null` |
156+
| customItemPosition | `CustomItemPosition` | Allow users set custom item in the picker with several positions. | `CustomItemPosition.none` |
157+
| routeCurve | `Curve` | The curve which the picker use to build page route transition. | `Curves.easeIn` |
158+
| routeDuration | `Duration` | The duration which the picker use to build page route transition. | `const Duration(milliseconds: 500)` |
203159

204160
### Simple usage
205161

0 commit comments

Comments
 (0)