Skip to content

Commit 095916f

Browse files
committed
📝 Update migration guide
1 parent 2d257ac commit 095916f

File tree

1 file changed

+62
-15
lines changed

1 file changed

+62
-15
lines changed

guides/migration_guide.md

Lines changed: 62 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,80 @@
11
# Migration Guide
22

3-
## Migrate to 5.0.0
3+
This document gathered all breaking changes and migrations requirement between major versions.
4+
5+
## References
6+
7+
API documentation:
8+
- `AssetPickerBuilderDelegate`:
9+
- https://pub.dev/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerBuilderDelegate-class.html
10+
- https://pub.flutter-io.cn/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerBuilderDelegate-class.html
11+
- `AssetPickerViewerBuilderDelegate`:
12+
- https://pub.dev/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerViewerBuilderDelegate-class.html
13+
- https://pub.flutter-io.cn/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerViewerBuilderDelegate-class.html
14+
- `AssetPickerProvider`:
15+
- https://pub.dev/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerProvider-class.html
16+
- https://pub.flutter-io.cn/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerProvider-class.html
17+
- `AssetPickerViewerProvider`:
18+
- https://pub.dev/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerViewerProvider-class.html
19+
- https://pub.flutter-io.cn/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerViewerProvider-class.html
20+
- `AssetsPickerTextDelegate`:
21+
- https://pub.dev/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetsPickerTextDelegate-class.html
22+
- https://pub.flutter-io.cn/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetsPickerTextDelegate-class.html
23+
24+
## Major versions
25+
26+
- [6.0.0](#6.0.0)
27+
- [5.0.0](#5.0.0)
28+
29+
## 6.0.0
30+
31+
### Summary
32+
33+
_If you didn't extend `AssetPickerBuilderDelegate` or `AssetTextDelegate` to build delegates on your own,
34+
you can stop reading._
35+
36+
- User who extended `AssetPickerBuilderDelegate` needs to update the subclass with the latest changes.
37+
- `AssetsPickerTextDelegate` is not abstract anymore.
38+
39+
### Details
40+
41+
#### `AssetPickerBuilderDelegate`
42+
43+
- This delegate requires a new argument `initialPermission` with `PermissionState` type when using.
44+
The intention of this change is to be capable with various of `PermissionState`.
45+
If your delegate didn't require a permission check, you can pass `PermissionState.authorized` directly.
46+
47+
- `assetsGridBuilder` is not implemented by default.
48+
49+
- The `findChildIndexBuilder` and `assetsGridItemCount` methods have new signature.
50+
They require calculating placeholders count on iOS/macOS by default.
51+
52+
#### `AssetsPickerTextDelegate`
53+
54+
- This delegate is now a normal class with Chinese language implemented by default,
55+
which makes `DefaultAssetsPickerTextDelegate` removed. So if you used to use `DefaultAssetsPickerTextDelegate()`,
56+
use `AssetsPickerTextDelegate()` instead.
57+
58+
## 5.0.0
459

560
### Summary
661

762
_If you only use the `AssetPicker.pickAssets` and `AssetEntityImageProvider`,
863
didn't use `AssetPickerViewer`, `AssetPickerProvider`, or other components separately,
964
you can stop reading._
1065

11-
`AssetPicker` and `AssetPickerViewer` are only a builder since 5.x, all widgets construct were moved
12-
to `AssetPickerBuilderDelegate` and `AssetPickerViewerBuilderDelegate`, and these delegates are both
13-
abstract.
66+
The `AssetPicker` and the `AssetPickerViewer` are only a builder since 5.x,
67+
all widgets construct were moved to `AssetPickerBuilderDelegate` and `AssetPickerViewerBuilderDelegate`,
68+
and these delegates are both abstract.
1469

1570
By splitting delegates, now you can build your own picker with custom types, style, and widgets.
1671

17-
### Migration steps
72+
#### Details
1873

1974
For how to implement a custom picker, see the example's custom page for more implementation details.
2075

21-
* If you have ever use `AssetPickerViewer.pushToViewer`, the properties `assets` has changed to
76+
- If you have ever use `AssetPickerViewer.pushToViewer`, the properties `assets` has changed to
2277
`previewAssets`.
2378

24-
* If you have extends an `AssetPickerProvider` or `AssetPickerViewerProvider`, it now requires you
79+
- If you have extended an `AssetPickerProvider` or `AssetPickerViewerProvider`, it now requires you
2580
to pass generic type `A` and `P`, and handle the entities on your own.
26-
27-
### References
28-
29-
API documentation:
30-
* `AssetPickerBuilderDelegate`: https://pub.dev/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerBuilderDelegate-class.html
31-
* `AssetPickerViewerBuilderDelegate`: https://pub.dev/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerViewerBuilderDelegate-class.html
32-
* `AssetPickerProvider`: https://pub.dev/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerProvider-class.html
33-
* `AssetPickerViewerProvider`: https://pub.dev/documentation/wechat_assets_picker/latest/wechat_assets_picker/AssetPickerViewerProvider-class.html

0 commit comments

Comments
 (0)