Skip to content

Commit 8fd2c12

Browse files
committed
📝 Add dependencies overrides into documents.
1 parent 3b4e3df commit 8fd2c12

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

README-ZH.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ Language: [English](README.md) | 中文简体
3131
* [类介绍](#类介绍-)
3232
* [`AssetEntity`](#assetentity)
3333
* [常见问题](#常见问题-)
34+
* [`xxx` 版本获取冲突 (例如 `dartx`)](#xxx-版本获取冲突-例如-dartx)
3435
* [如何获取资源的路径以进行上传或编辑等操作的整合?](#如何获取资源的路径以进行上传或编辑等操作的整合)
3536
* [`File``Uint8List`创建`AssetEntity`的方法](#从file或uint8list创建assetentity的方法)
3637
* [控制台提示 'Failed to find GeneratedAppGlideModule'](#控制台提示-failed-to-find-generatedappglidemodule)
@@ -68,7 +69,7 @@ Language: [English](README.md) | 中文简体
6869

6970
Flutter SDK:`>=1.17.0`
7071

71-
如果在 `flutter pub get` 时遇到了失败问题,请使用 `dependency_overrides` 解决。
72+
如果在 `flutter pub get` 时遇到了失败问题,请使用 `dependency_overrides` 解决。参考[这里](#xxx-版本获取冲突-例如-dartx)
7273

7374
### Flutter
7475

@@ -296,6 +297,22 @@ Future<AssetEntity> refreshProperties() async;
296297

297298
## 常见问题 ❔
298299

300+
### `xxx` 版本获取冲突 (例如 `dartx`)
301+
302+
`dartx` 或其他依赖可能因为某些原因使用了与你的项目不同的版本。如果你遇到了与下面内容类似的错误::
303+
304+
```
305+
Because dartx >=0.2.0 <0.5.0 depends on collection >=1.14.11 <1.15.0 and every version of flutter from sdk depends on collection 1.15.0-nullsafety, dartx >=0.2.0 <0.5.0 is incompatible with flutter from sdk.
306+
So, because wechat_assets_picker_demo depends on both flutter any from sdk and dartx ^0.4.2, version solving failed.
307+
```
308+
309+
将以下代码添加至你的 `pubspec.yaml`
310+
311+
```yaml
312+
dependency_overrides:
313+
dartx: ^0.4.2
314+
```
315+
299316
### 如何获取资源的路径以进行上传或编辑等操作的整合?
300317
301318
你不需要获得路径(也许)。

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ This project follows the [all-contributors](https://github.com/all-contributors/
5151
* [Classes Introduction](#classes-introduction-)
5252
* [`AssetEntity`](#assetentity)
5353
* [Frequent asked question](#frequent-asked-question-)
54+
* [Version resolve conflict with `xxx` (e.g. `dartx`)](#version-resolve-conflict-with-xxx-e.g.-dartx)
5455
* [How can I get path from the `AssetEntity` to integrate with `File` object, upload or edit?](#how-can-i-get-path-from-the-assetentity-to-integrate-with-file-object-upload-or-edit)
5556
* [Create `AssetEntity` from `File` or `Uint8List` (rawData)](#create-assetentity-from-file-or-uint8list-rawdata)
5657
* [Console warning 'Failed to find GeneratedAppGlideModule'](#glide-warning-failed-to-find-generatedappglidemodule)
@@ -88,7 +89,7 @@ Althought the package provide selection for assets, it still require users build
8889

8990
Flutter SDK: `>=1.17.0` .
9091

91-
If you got an error about `resolve conflict` when running `flutter pub get` , please use `dependency_overrides` to solve it.
92+
If you got an error about `resolve conflict` when running `flutter pub get` , please use `dependency_overrides` to solve it. See [here](#version-resolve-conflict-with-xxx-e.g.-dartx) .
9293

9394
### Flutter
9495

@@ -315,6 +316,22 @@ Future<AssetEntity> refreshProperties() async;
315316

316317
## Frequent asked question ❔
317318

319+
### Version resolve conflict with `xxx` (e.g. `dartx`)
320+
321+
For some reasons `dartx` or other packages may require a different version than yours. If you're facing this issue, and the error looks like:
322+
323+
```
324+
Because dartx >=0.2.0 <0.5.0 depends on collection >=1.14.11 <1.15.0 and every version of flutter from sdk depends on collection 1.15.0-nullsafety, dartx >=0.2.0 <0.5.0 is incompatible with flutter from sdk.
325+
So, because wechat_assets_picker_demo depends on both flutter any from sdk and dartx ^0.4.2, version solving failed.
326+
```
327+
328+
Please add the code below to make it work.
329+
330+
```yaml
331+
dependency_overrides:
332+
dartx: ^0.4.2
333+
```
334+
318335
### How can I get path from the `AssetEntity` to integrate with `File` object, upload or edit?
319336

320337
You don't need it (might be).

0 commit comments

Comments
 (0)