Skip to content

Commit e07da55

Browse files
authored
5.0 refactor
2 parents c055a1d + bcfea47 commit e07da55

28 files changed

+4386
-2045
lines changed

.github/workflows/build_test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Build test
22

3-
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
3+
on: [push, pull_request]
84

95
jobs:
106
test_iOS:

.github/workflows/minimum_stable_version_test.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
name: Minumum stable version capability test
22

3-
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
3+
on: [push, pull_request]
84

95
jobs:
106
analysis:

CHANGELOG.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 5.0.0-dev.1
8+
9+
- Allow users build their own picker with custom assets types. (See example.)
10+
11+
### Breaking changes
12+
13+
- Abstract `AssetPickerBuilderDelegate<A, P>`, `AssetPickerViewerBuilderDelegate<A, P>`,
14+
`AssetPickerProvider<A, P>`, and minify the `AssetPickerViewerProvider<A>`. Support
15+
custom types by generic type.
16+
17+
- The `assets` param in `AssetPickerViewer.pushToViewer` is now `previewAssets`.
18+
719
## 4.2.2
820

921
- Suppress deprecated usage in example.
@@ -50,7 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5062
- Experimenting status bar hidden on iOS.
5163
- Remove video player listener before pause.
5264

53-
## Breaking changes
65+
### Breaking changes
5466

5567
- `TextDelegate` -> `AssetsPickerTextDelegate` .
5668

@@ -113,7 +125,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
113125
- Enlarge preview button's detector area size.
114126
- Fix wrong properties usage causing infinite build when the page reaches the end.
115127

116-
## Breaking changes
128+
### Breaking changes
117129

118130
- `videoIndicatorBuilder` -> `durationIndicatorBuilder`.
119131

README-ZH.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Language: [English](README.md) | 中文简体
1717

1818
## 目录 🗂
1919

20+
* [迁移指南](#迁移指南-)
2021
* [特性](#特性-)
2122
* [截图](#截图-)
2223
* [准备工作](#准备工作-)
@@ -38,6 +39,10 @@ Language: [English](README.md) | 中文简体
3839
* [`File``Uint8List`创建`AssetEntity`的方法](#从file或uint8list创建assetentity的方法)
3940
* [控制台提示 'Failed to find GeneratedAppGlideModule'](#控制台提示-failed-to-find-generatedappglidemodule)
4041

42+
## 迁移指南 ♻️
43+
44+
查看 [迁移指南](doc/migration_guide.md).
45+
4146
## 特性 ✨
4247

4348
- [x] 💚 99%的微信风格

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ This project follows the [all-contributors](https://github.com/all-contributors/
3838

3939
## Category 🗂
4040

41+
* [Migration Guide](#migration-guide-)
4142
* [Features](#features-)
4243
* [Screenshots](#screenshots-)
4344
* [Preparing for use](#preparing-for-use-)
@@ -59,6 +60,10 @@ This project follows the [all-contributors](https://github.com/all-contributors/
5960
* [Create `AssetEntity` from `File` or `Uint8List` (rawData)](#create-assetentity-from-file-or-uint8list-rawdata)
6061
* [Console warning 'Failed to find GeneratedAppGlideModule'](#glide-warning-failed-to-find-generatedappglidemodule)
6162

63+
## Migration Guide ♻️
64+
65+
See [Migration Guide](doc/migration_guide.md).
66+
6267
## Features ✨
6368

6469
- [x] 💚 99% simillar to WeChat style.

doc/migration_guide.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Migration Guide
2+
3+
## Migrate to 5.0.0
4+
5+
### Summary
6+
7+
_If you only use the `AssetPicker.pickAssets` and `AssetEntityImageProvider`,
8+
didn't use `AssetPickerViewer`, `AssetPickerProvider`, or other components separately,
9+
you can stop reading._
10+
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.
14+
15+
By splitting delegates, now you can build your own picker with custom types, style, and widgets.
16+
17+
### Migration steps
18+
19+
For how to implement a custom picker, see the example's custom page for more implementation details.
20+
21+
* If you have ever use `AssetPickerViewer.pushToViewer`, the properties `assets` has changed to
22+
`previewAssets`.
23+
24+
* If you have extends an `AssetPickerProvider` or `AssetPickerViewerProvider`, it now requires you
25+
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

example/lib/constants/resource.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/// Generate by [resource_generator](https://github.com/CaiJingLong/flutter_resource_generator) library.
22
/// PLEASE DO NOT EDIT MANUALLY.
33
class R {
4-
/// ![preview](file:///assets/flutter_candies_logo.png)
54
static const String ASSETS_FLUTTER_CANDIES_LOGO_PNG =
65
'assets/flutter_candies_logo.png';
76
}

0 commit comments

Comments
 (0)