Skip to content

Commit 9e6d781

Browse files
committed
📝 Update READMEs
1 parent 2b6dcfb commit 9e6d781

File tree

2 files changed

+142
-7
lines changed

2 files changed

+142
-7
lines changed

README-ZH.md

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ Language: [English](README.md) | 中文简体
4747

4848
## 特性 ✨
4949

50+
- ♿ 完整的无障碍支持,包括 **TalkBack****VoiceOver**
5051
- ♻️ 支持基于 `State` 重载的全量自定义
51-
- 💚 99% 的微信风格
52+
- 🎏 完全可自定义的基于 `ThemeData` 的主题
53+
- 💚 复刻微信风格(甚至优化了更多的细节)
54+
- ⚡️ 根据配置调节的性能优化
5255
- 📷 支持拍照
5356
- 🎥 支持录像
5457
- ⏱ 支持限制录像时间
@@ -57,7 +60,6 @@ Language: [English](README.md) | 中文简体
5760
- 🔍️ 支持捏合缩放
5861
- 💱 国际化支持
5962
- ⏪ RTL 语言支持
60-
- 🎏 完整的自定义主题
6163
- 🖾 支持自定义前景 widget 构建
6264
- 🕹️ 保存时拦截自定义操作
6365

@@ -67,19 +69,68 @@ Language: [English](README.md) | 中文简体
6769
|-------------------------------------------------------------------------|-------------------------------------------------------------------------|
6870
| ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6z1h7xj30u01t01kx.jpg) | ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6zarvhj30u01t0x5f.jpg) |
6971

72+
## 开始前的注意事项 ‼️
73+
74+
在开始一切之前,请明确以下两点:
75+
- 由于理解差异和篇幅限制,并不是所有的内容都会明确地在文档中指出。
76+
当你遇到没有找到需求和无法理解的概念时,请先运行项目的示例 example,
77+
它可以解决 90% 的常见需求。
78+
- 该库与 [photo_manager][photo_manager pub] 有强关联性,
79+
大部分方法的行为是由 photo_manager 进行控制的,
80+
所以请尽可能地确保你了解以下两个类的概念:
81+
- 资源(图片/视频/音频) [`AssetEntity`](https://pub.flutter-io.cn/documentation/photo_manager/latest/photo_manager/AssetEntity-class.html)
82+
- 资源合集(相册或集合概念) [`AssetPathEntity`](https://pub.flutter-io.cn/documentation/photo_manager/latest/photo_manager/AssetPathEntity-class.html)
83+
84+
当你有与相关的 API 和行为的疑问时,你可以查看
85+
[photo_manager API 文档][] 了解更多细节。
86+
87+
众多使用场景都已包含在示例中。
88+
在你提出任何问题之前,请仔细并完整地查看和使用示例。
89+
7090
## 准备工作 🍭
7191

72-
### 版本限制
92+
### 版本兼容
93+
94+
该插件仅保证能与 **stable 渠道的 Flutter SDK** 配合使用。
95+
我们不会为其他渠道的 Flutter SDK 做实时支持。
7396

7497
Flutter SDK:`>=2.8.0`
7598

99+
如果在 `flutter pub get` 时遇到了 `resolve conflict` 失败问题,
100+
请使用 `dependency_overrides` 解决。
101+
76102
### 配置
77103

104+
执行 `flutter pub add wechat_camera_picker`
105+
或者将 `wechat_camera_picker` 手动添加至 `pubspec.yaml` 引用。
106+
107+
```yaml
108+
dependencies:
109+
wechat_camera_picker: ^latest_version
110+
```
111+
112+
最新的 **稳定** 版本是:
113+
[![pub package](https://img.shields.io/pub/v/wechat_camera_picker?logo=dart&label=stable&style=flat-square)](https://pub.flutter-io.cn/packages/wechat_camera_picker)
114+
115+
最新的 **开发** 版本是:
116+
[![pub package](https://img.shields.io/pub/v/wechat_camera_picker?color=9d00ff&include_prereleases&label=dev&logo=dart&style=flat-square)](https://pub.flutter-io.cn/packages/wechat_camera_picker)
117+
118+
在你的代码中导入:
119+
120+
```dart
121+
import 'package:wechat_camera_picker/wechat_camera_picker.dart';
122+
```
123+
124+
更多配置步骤:
78125
- [wechat_assets_picker#准备工作](https://github.com/fluttercandies/flutter_wechat_assets_picker/blob/master/README-ZH.md#preparing-for-use-)
79126
- [camera#installation](https://pub.flutter-io.cn/packages/camera#installation)
80127

81128
#### Android 13 (API 33) 权限配置
82129

130+
在使用这个 package 时,请确保
131+
`compileSdkVersion``targetSdkVersion` 升级到 `33`
132+
否则,在 Android 13 设备上将有可能无法加载任何资源。
133+
83134
如果你不需要拍照或录像,你可以考虑将对应权限移除:
84135

85136
```xml
@@ -95,6 +146,20 @@ Flutter SDK:`>=2.8.0` 。
95146

96147
## 使用方法 📖
97148

149+
### 国际化
150+
151+
当你在选择资源的时候,package 会通过你的 `BuildContext`
152+
读取 `Locale?`,返回对应语言的文字代理实现。
153+
请确保你可以通过 `BuildContext` 获取到 `Locale`,否则将会 **默认展示中文文字**
154+
155+
内置的语言文字实现有:
156+
* 简体中文 (默认)
157+
* English
158+
* Tiếng Việt
159+
160+
如果你想使用自定义或固定的文字实现,请通过
161+
`CameraPickerConfig.textDelegate` 传递调用。
162+
98163
### 简单的使用方法
99164

100165
```dart
@@ -178,4 +243,5 @@ final AssetEntity? entity = await CameraPicker.pickFromCamera(
178243
https://github.com/flutter/flutter/issues/89216
179244
除此之外的问题,你可以提交 issue 进行提问。
180245

246+
[photo_manager pub]: https://pub.flutter-io.cn/packages/photo_manager
181247
[迁移指南]: https://github.com/fluttercandies/flutter_wechat_camera_picker/blob/main/guides/migration_guide.md

README.md

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ See the [Migration Guide][] to learn how to migrate between breaking changes.
3232
* [Flutter WeChat Camera Picker](#flutter-wechat-camera-picker)
3333
* [Features ✨](#features-)
3434
* [Screenshots 📸](#screenshots-)
35+
* [READ THIS FIRST ‼️](#read-this-first-)
3536
* [Preparing for use 🍭](#preparing-for-use-)
36-
* [Version constraints](#version-constraints)
37+
* [Versions compatibility](#versions-compatibility)
3738
* [Setup](#setup)
3839
* [Android 13 (API 33) permissions](#android-13-api-33-permissions)
3940
* [Usage 📖](#usage-)
41+
* [Localizations](#localizations)
4042
* [Simple usage](#simple-usage)
4143
* [With configurations](#with-configurations)
4244
* [Using custom `State`s](#using-custom-states)
@@ -48,8 +50,11 @@ See the [Migration Guide][] to learn how to migrate between breaking changes.
4850

4951
## Features ✨
5052

53+
- ♿ Complete a11y support with _TalkBack_ and _VoiceOver_
5154
- ♻️ Fully implementable with `State`s override
52-
- 💚 99% similar to WeChat style
55+
- 🎏 Fully customizable theme based on `ThemeData`
56+
- 💚 Completely WeChat style (even more)
57+
- ⚡️ Adjustable performance with different configurations
5358
- 📷 Picture taking support
5459
- 🎥 Video recording support
5560
- ⏱ Duration limitation support
@@ -58,7 +63,6 @@ See the [Migration Guide][] to learn how to migrate between breaking changes.
5863
- 🔍️ Scale with pinch support
5964
- 💱 i18n support
6065
- ⏪ RTL language support
61-
- 🎏 Fully customizable theme
6266
- 🖾 Foreground custom widget builder support
6367
- 🕹️ Intercept saving with custom process
6468

@@ -68,19 +72,68 @@ See the [Migration Guide][] to learn how to migrate between breaking changes.
6872
|-------------------------------------------------------------------------|-------------------------------------------------------------------------|
6973
| ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6z1h7xj30u01t01kx.jpg) | ![](https://tva1.sinaimg.cn/large/007S8ZIlgy1ggtt6zarvhj30u01t0x5f.jpg) |
7074

75+
## READ THIS FIRST ‼️
76+
77+
Be aware of below notices before you started anything:
78+
- Due to understanding differences and the limitation of a single document,
79+
documents will not cover all the contents.
80+
If you find nothing related to your expected features and cannot understand about concepts,
81+
run the example project and check every options first.
82+
It has covered 90% of regular requests with the package.
83+
- The package deeply integrates with the [photo_manager][photo_manager pub] plugin,
84+
make sure you understand these two concepts as much as possible:
85+
- Asset (photos/videos/audio) - [`AssetEntity`](https://pub.dev/documentation/photo_manager/latest/photo_manager/AssetEntity-class.html)
86+
- Assets collection (albums/libraries) - [`AssetPathEntity`](https://pub.dev/documentation/photo_manager/latest/photo_manager/AssetPathEntity-class.html)
87+
88+
When you have questions about related APIs and behaviors,
89+
check [photo_manager's API docs][] for more details.
90+
91+
Most usages are detailed covered by the [example](example).
92+
Please walk through the [example](example) carefully
93+
before you have any questions.
94+
7195
## Preparing for use 🍭
7296

73-
### Version constraints
97+
### Versions compatibility
98+
99+
The package only guarantees to be working on **the stable version of Flutter**.
100+
We won't update it in real-time to align with other channels of Flutter.
74101

75102
Flutter SDK: `>=2.8.0` .
76103

104+
If you got a `resolve conflict` error when running `flutter pub get`,
105+
please use `dependency_overrides` to fix it.
106+
77107
### Setup
78108

109+
Run `flutter pub add wechat_camera_picker`,
110+
or add `wechat_camera_picker` to `pubspec.yaml` dependencies manually.
111+
```yaml
112+
dependencies:
113+
wechat_camera_picker: ^latest_version
114+
```
115+
116+
The latest **stable** version is:
117+
[![pub package](https://img.shields.io/pub/v/wechat_camera_picker?logo=dart&label=stable&style=flat-square)](https://pub.dev/packages/wechat_camera_picker)
118+
119+
The latest **dev** version is:
120+
[![pub package](https://img.shields.io/pub/v/wechat_camera_picker?color=9d00ff&include_prereleases&label=dev&logo=dart&style=flat-square)](https://pub.dev/packages/wechat_camera_picker)
121+
122+
Then import the package in your code:
123+
```dart
124+
import 'package:wechat_camera_picker/wechat_camera_picker.dart';
125+
```
126+
127+
See also:
79128
- [wechat_assets_picker#preparing-for-use](https://github.com/fluttercandies/flutter_wechat_assets_picker#preparing-for-use-)
80129
- [camera#installation](https://pub.dev/packages/camera#installation)
81130

82131
#### Android 13 (API 33) permissions
83132

133+
When using the package, please upgrade
134+
`targetSdkVersion` and `compileSdkVersion` to `33`.
135+
Otherwise, no assets can be fetched on Android 13.
136+
84137
If you don't need to take photos or videos,
85138
consider removing relevant permission in your apps, more specifically:
86139

@@ -97,6 +150,22 @@ consider removing relevant permission in your apps, more specifically:
97150

98151
## Usage 📖
99152

153+
### Localizations
154+
155+
When you're picking assets, the package will obtain the `Locale?`
156+
from your `BuildContext`, and return the corresponding text delegate
157+
of the current language.
158+
Make sure you have a valid `Locale` in your widget tree that can be accessed
159+
from the `BuildContext`. **Otherwise, the default Chinese delegate will be used.**
160+
161+
Embedded text delegates languages are:
162+
* 简体中文 (default)
163+
* English
164+
* Tiếng Việt
165+
166+
If you want to use a custom/fixed text delegate, pass it through the
167+
`CameraPickerConfig.textDelegate`.
168+
100169
### Simple usage
101170

102171
```dart

0 commit comments

Comments
 (0)