|
1 | 1 | # Migration Guide
|
2 | 2 |
|
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 |
4 | 59 |
|
5 | 60 | ### Summary
|
6 | 61 |
|
7 | 62 | _If you only use the `AssetPicker.pickAssets` and `AssetEntityImageProvider`,
|
8 | 63 | didn't use `AssetPickerViewer`, `AssetPickerProvider`, or other components separately,
|
9 | 64 | you can stop reading._
|
10 | 65 |
|
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. |
14 | 69 |
|
15 | 70 | By splitting delegates, now you can build your own picker with custom types, style, and widgets.
|
16 | 71 |
|
17 |
| -### Migration steps |
| 72 | +#### Details |
18 | 73 |
|
19 | 74 | For how to implement a custom picker, see the example's custom page for more implementation details.
|
20 | 75 |
|
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 |
22 | 77 | `previewAssets`.
|
23 | 78 |
|
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 |
25 | 80 | 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