Skip to content

Commit 27e5975

Browse files
committed
📝 Improve READMEs
1 parent 9c9b54e commit 27e5975

File tree

2 files changed

+75
-56
lines changed

2 files changed

+75
-56
lines changed

README-ZH.md

Lines changed: 40 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ that can be found in the LICENSE file. -->
1818
Language: [English](README.md) | 中文
1919

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

2525
需要拍照及录制视频,请查看示例的详细用法,
26-
并前往 [wechat_camera_picker](https://pub.flutter-io.cn/packages/wechat_camera_picker)
26+
并前往 [wechat_camera_picker][wechat_camera_picker pub]
2727

2828
当前的界面设计基于的微信版本:**8.x**
2929
界面更新将在微信版本更新后随时进行跟进。
@@ -58,7 +58,7 @@ Language: [English](README.md) | 中文
5858

5959
## 迁移指南 ♻️
6060

61-
查看 [迁移指南](guides/migration_guide.md).
61+
查看 [迁移指南][]
6262

6363
## 特性 ✨
6464

@@ -89,10 +89,13 @@ Language: [English](README.md) | 中文
8989

9090
## 开始前的注意事项 ‼️
9191

92-
尽管该库提供了资源的选择,其仍然要求使用者构建自己的方法来处理显示、上传等操作。
93-
如果你在使用该库的过程对某些方法或API有疑问,请运行示例并查看
94-
[photo_manager](https://github.com/CaiJingLong/flutter_photo_manager)
95-
对相关方法的使用说明。
92+
该库与 [photo_manager][photo_manager pub] 有强关联性,
93+
大部分方法的行为是由 photo_manager 进行控制的。
94+
当你有与相关的 API 和行为的疑问时,你可以查看
95+
[photo_manager API 文档][] 了解更多细节。
96+
97+
众多使用场景都已包含在示例中。
98+
在你提出任何问题之前,请仔细并完整地查看和使用示例。
9699

97100
## 准备工作 🍭
98101

@@ -108,7 +111,8 @@ Language: [English](README.md) | 中文
108111

109112
### Flutter
110113

111-
`wechat_assets_picker` 添加至 `pubspec.yaml` 引用。
114+
执行 `flutter pub add wechat_assets_picker`
115+
或者将 `wechat_assets_picker` 手动添加至 `pubspec.yaml` 引用。
112116

113117
```yaml
114118
dependencies:
@@ -138,17 +142,17 @@ import 'package:wechat_assets_picker/wechat_assets_picker.dart';
138142
详情请参考示例。
139143

140144
如果你发现有一些与 `Glide` 有关的警告日志输出,
141-
那么主项目就需要实现 `AppGlideModule`详细信息请查看
142-
[Generated API](https://muyangmin.github.io/glide-docs-cn/doc/generatedapi.html).
145+
那么主项目就需要实现 `AppGlideModule`
146+
详细信息请查看 [Generated API 文档][]
143147

144148
### iOS
145149

146-
`ios/Podfile` 中指定最低构建版本至 **9.0**
150+
1. `ios/Podfile` 中指定最低构建版本至 **9.0**
147151
```ruby
148152
platform :ios, '9.0'
149153
```
150154

151-
将以下内容添加至 `info.plist`
155+
2. 将以下内容添加至 `info.plist`
152156
```plist
153157
<key>NSAppTransportSecurity</key>
154158
<dict>
@@ -161,19 +165,15 @@ platform :ios, '9.0'
161165

162166
### macOS
163167

164-
目前 Flutter 桌面版仍然在开发阶段,所以请注意,
165-
任何与桌面版本有关的问题都不会受到技术支持。
166-
167168
1.`macos/Podfile` 中指定最低构建版本至 **10.15**
168-
169+
```ruby
170+
platform :osx, '10.15'
171+
```
169172
2. 使用 **Xcode** 打开 `macos/Runner.xcworkspace`
170173
接着根据下面的截图将最低构建版本提升至 **10.15**
171-
172174
3. ![step 1](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghw67v4yk4j30qy0b50u0.jpg)
173-
174175
4. ![step 2](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghw67vd3f2j30jv04zgm5.jpg)
175-
176-
5. 与 iOS 一样,添加相同的东西到 `info.plist` 里。
176+
5. 与 iOS 一样,添加相同的内容到 `info.plist` 里。
177177

178178
## 使用方法 📖
179179

@@ -257,8 +257,7 @@ final List<AssetEntity>? result = await AssetPicker.pickAssets(
257257
(与 `photo_manager` 完全无关)实现的选择器,
258258
以及一个多 Tab 页切换的选择器。
259259
如果你觉得你的实现有价值或能帮助到其他人,欢迎以 PR 的形式进行提交。
260-
更多细节请阅读
261-
[贡献自定义实现][example/lib/customs/CONTRIBUTING.md]
260+
更多细节请阅读 [贡献自定义实现][]
262261

263262
### 展示选中的资源
264263

@@ -299,8 +298,6 @@ AssetPicker.unregisterObserve();
299298

300299
查看 [photo_manager#561][] 了解详细的解决方法。
301300

302-
[photo_manager#561]: https://github.com/CaiJingLong/flutter_photo_manager/issues/561
303-
304301
### 如何获取资源的路径以进行上传或编辑等操作的整合?
305302

306303
你不需要获得路径(也许)。
@@ -342,10 +339,12 @@ final AssetEntity imageEntity = await PhotoManager.editor.saveImage(
342339
否则在调用 `AssetEntity` 的删除时,某些系统下会触发系统弹窗事件:
343340

344341
```dart
345-
final List<String> result = await PhotoManager.editor.deleteWithIds([entity.id]);
342+
final List<String> result = await PhotoManager.editor.deleteWithIds(
343+
<String>[entity.id],
344+
);
346345
```
347346

348-
参考文档:[flutter_photo_manager#insert-new-item](https://github.com/CaiJingLong/flutter_photo_manager#insert-new-item)
347+
参考文档:[photo_manager#insert-new-item][]
349348

350349
### 控制台提示 'Failed to find GeneratedAppGlideModule'
351350

@@ -367,4 +366,16 @@ W/Glide (21133): Failed to find GeneratedAppGlideModule. You should include an
367366
[IntelliJ IDEA](https://www.jetbrains.com/idea/?from=fluttercandies)
368367
等 IDE 的授权。
369368

370-
[<img src="https://github.com/fluttercandies/flutter_wechat_assets_picker/raw/master/.github/jetbrains-variant.png" width="200"/>](https://www.jetbrains.com/?from=fluttercandies)
369+
[<img src="https://github.com/fluttercandies/flutter_wechat_assets_picker/raw/master/.github/jetbrains-variant.png" width="200"/>](https://www.jetbrains.com/?from=fluttercandies)
370+
371+
372+
[photo_manager pub]: https://pub.flutter-io.cn/packages/photo_manager
373+
[extended_image pub]: https://pub.flutter-io.cn/packages/extended_image
374+
[provider pub]: https://pub.flutter-io.cn/packages/provider
375+
[wechat_camera_picker pub]: https://pub.flutter-io.cn/packages/wechat_camera_picker
376+
[迁移指南]: https://github.com/fluttercandies/flutter_wechat_assets_picker/blob/main/guides/migration_guide.md
377+
[photo_manager API 文档]: https://pub.flutter-io.cn/documentation/photo_manager/latest/
378+
[Generated API 文档]: https://muyangmin.github.io/glide-docs-cn/doc/generatedapi.html
379+
[贡献自定义实现]: https://github.com/fluttercandies/flutter_wechat_assets_picker/blob/main/example/lib/customs/CONTRIBUTING.md
380+
[photo_manager#561]: https://github.com/CaiJingLong/flutter_photo_manager/issues/561
381+
[photo_manager#insert-new-item]: https://github.com/CaiJingLong/flutter_photo_manager#insert-new-item

README.md

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,17 @@ that can be found in the LICENSE file. -->
1717

1818
Language: English | [中文](README-ZH.md)
1919

20-
An **assets picker** which based on the WeChat's UI,
21-
using [`photo_manager`](https://pub.dev/packages/photo_manager)
22-
for asset implementation,
23-
[`extended_image`](https://pub.dev/packages/extended_image)
20+
An **assets' picker** based on the WeChat's UI,
21+
using [photo_manager][photo_manager pub] for asset implementation,
22+
[extended_image][extended_image pub]
2423
for image preview,
25-
and [`provider`](https://pub.dev/packages/provider)
24+
and [provider][provider pub]
2625
to help control the state of the picker.
2726

2827
To take a photo or a video for assets,
2928
please check the detailed usage in the example,
3029
and head over to
31-
[wechat_camera_picker](https://pub.dev/packages/wechat_camera_picker).
30+
[wechat_camera_picker][wechat_camera_picker pub].
3231

3332
Current WeChat version that UI based on: **8.x**
3433
UI designs will be updated following the WeChat update in anytime.
@@ -59,7 +58,7 @@ UI designs will be updated following the WeChat update in anytime.
5958

6059
## Migration Guide ♻️
6160

62-
See [Migration Guide](guides/migration_guide.md).
61+
See [Migration Guide][].
6362

6463
## Features ✨
6564

@@ -90,13 +89,14 @@ See [Migration Guide](guides/migration_guide.md).
9089

9190
## READ THIS FIRST ‼️
9291

93-
Although the package provides assets selection,
94-
it still requires users to build their own methods
95-
to handle upload, image compress, etc.
96-
If you have any questions about how to build them,
97-
please run the example or refer to
98-
[photo_manager](https://github.com/CaiJingLong/flutter_photo_manager)
99-
for API usages.
92+
The package works closely with the [photo_manager][photo_manager pub] plugin,
93+
and most behaviors are controlled by the plugin.
94+
When you have questions about related APIs and behaviors,
95+
check [photo_manager's API docs][] for more details.
96+
97+
Most usages are detailed covered by the example.
98+
Please walk through the example carefully
99+
before you have any questions.
100100

101101
## Preparing for use 🍭
102102

@@ -112,7 +112,8 @@ please use `dependency_overrides` to fix it.
112112

113113
### Flutter
114114

115-
Add `wechat_assets_picker` to `pubspec.yaml` dependencies.
115+
Run `flutter pub add wechat_assets_picker`,
116+
or add `wechat_assets_picker` to `pubspec.yaml` dependencies manually.
116117
```yaml
117118
dependencies:
118119
wechat_assets_picker: ^latest_version
@@ -141,7 +142,7 @@ See the example for the detailed usage.
141142

142143
If you found some warning logs with `Glide` appearing,
143144
then the main project needs an implementation of `AppGlideModule`.
144-
See [Generated API](https://sjudd.github.io/glide/doc/generatedapi.html).
145+
See [Generated API docs][].
145146

146147
### iOS
147148

@@ -152,7 +153,7 @@ platform :ios, '9.0'
152153
```
153154

154155
2. Add the following content to `info.plist`.
155-
```
156+
```plist
156157
<key>NSAppTransportSecurity</key>
157158
<dict>
158159
<key>NSAllowsArbitraryLoads</key>
@@ -169,14 +170,10 @@ platform :ios, '9.0'
169170
```ruby
170171
platform :osx, '10.15'
171172
```
172-
173173
2. Set the minimum deployment target to *10.15*.
174174
Use XCode to open `macos/Runner.xcworkspace` .
175-
176175
3. ![step 1](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghw67v4yk4j30qy0b50u0.jpg)
177-
178176
4. ![step 2](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghw67vd3f2j30jv04zgm5.jpg)
179-
180177
5. Follow the iOS instructions and modify `info.plist` accordingly.
181178

182179
## Usage 📖
@@ -265,8 +262,7 @@ We've defined a picker that integrates with `Directory` and `File`
265262
and a picker with multiple tabs switching.
266263
You can submit PRs to create your own implementation
267264
if you found your implementation might be useful for others.
268-
See [Contribute custom implementations][lib/customs/CONTRIBUTING.md]
269-
for more details.
265+
See [Contribute custom implementations][] for more details.
270266

271267
### Display selected assets
272268

@@ -309,8 +305,6 @@ based on `<File, Directory>` types.
309305

310306
See [photo_manager#561][] for more details.
311307

312-
[photo_manager#561]: https://github.com/CaiJingLong/flutter_photo_manager/issues/561
313-
314308
### How can I get path from the `AssetEntity` to integrate with `File` object, upload or edit?
315309

316310
You don't need it (might be).
@@ -354,10 +348,12 @@ use `File` for operations as much as possible.**
354348
A deletion operation might call system popups with some OS:
355349

356350
```dart
357-
final List<String> result = await PhotoManager.editor.deleteWithIds([entity.id]);
351+
final List<String> result = await PhotoManager.editor.deleteWithIds(
352+
<String>[entity.id],
353+
);
358354
```
359355

360-
ref: [flutter_photo_manager#insert-new-item](https://github.com/CaiJingLong/flutter_photo_manager#insert-new-item)
356+
ref: [photo_manager#insert-new-item][]
361357

362358
### Glide warning 'Failed to find GeneratedAppGlideModule'
363359

@@ -421,3 +417,15 @@ for allocating free open-source licenses for IDEs
421417
such as [IntelliJ IDEA](https://www.jetbrains.com/idea/?from=fluttercandies).
422418

423419
[<img src="https://github.com/fluttercandies/flutter_wechat_assets_picker/raw/main/.github/jetbrains-variant.png" width="200"/>](https://www.jetbrains.com/?from=fluttercandies)
420+
421+
422+
[photo_manager pub]: https://pub.dev/packages/photo_manager
423+
[extended_image pub]: https://pub.dev/packages/extended_image
424+
[provider pub]: https://pub.dev/packages/provider
425+
[wechat_camera_picker pub]: https://pub.dev/packages/wechat_camera_picker
426+
[Migration Guide]: https://github.com/fluttercandies/flutter_wechat_assets_picker/blob/main/guides/migration_guide.md
427+
[photo_manager's API docs]: https://pub.dev/documentation/photo_manager/latest/
428+
[Generated API docs]: https://sjudd.github.io/glide/doc/generatedapi.html
429+
[Contribute custom implementations]: https://github.com/fluttercandies/flutter_wechat_assets_picker/blob/main/example/lib/customs/CONTRIBUTING.md
430+
[photo_manager#561]: https://github.com/CaiJingLong/flutter_photo_manager/issues/561
431+
[photo_manager#insert-new-item]: https://github.com/CaiJingLong/flutter_photo_manager#insert-new-item

0 commit comments

Comments
 (0)