Skip to content

Commit e3bf8e9

Browse files
dddropAlexV525
andauthored
🚀 Migrate to Flutter 3.7 (#410)
- Migrate `extended_image` `^6.2.0` to `^7.0.0` - Fix some deprecated changes from Material Theme System Updates - Fix a deprecated override of `buildViewportChrome` (flutter/flutter#111715) - Remove a unnecessary override --------- Co-authored-by: Alex Li <[email protected]>
1 parent 313fad8 commit e3bf8e9

19 files changed

+65
-64
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ that can be found in the LICENSE file. -->
44

55
# Changelog
66

7+
## 8.4.0
8+
9+
### Breaking changes
10+
11+
- Migrate to Flutter 3.7, drop supports for previous Flutter versions.
12+
713
## 8.3.2+1
814

915
### Improvements
@@ -138,7 +144,9 @@ To know more about breaking changes, see [Migration Guide][].
138144

139145
## 7.3.0
140146

141-
Migrate to Flutter 3, drop supports for previous Flutter versions.
147+
### Breaking changes
148+
149+
- Migrate to Flutter 3, drop supports for previous Flutter versions.
142150

143151
## 7.2.0
144152

README-ZH.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ Language: [English](README.md) | 中文
126126

127127
### 版本兼容
128128

129-
| | 2.8.0 | 2.10.0 | 3.0.0 | 3.3.0 |
130-
|--------|:-----:|:------:|:-----:|:-----:|
131-
| 8.0.0+ | 不适用 | 不适用 | ||
132-
| 7.3.0+ | 不适用 | 不适用 || |
133-
| 7.0.0+ | | | ||
134-
| 6.3.0+ || |||
129+
| | 2.10.0 | 3.0.0 | 3.3.0 | 3.7.0 |
130+
|--------|:------:|:-----:|:-----:|:-----:|
131+
| 8.4.0+ | | | ||
132+
| 8.0.0+ | | || |
133+
| 7.3.0+ | || ||
134+
| 7.0.0+ | | |||
135135

136136
如果在 `flutter pub get` 时遇到了 `resolve conflict` 失败问题,
137137
请使用 `dependency_overrides` 解决。

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,12 @@ before you have any questions.
132132

133133
### Versions compatibility
134134

135-
| | 2.8.0 | 2.10.0 | 3.0.0 | 3.3.0 |
136-
|--------|:-----:|:------:|:-----:|:-----:|
137-
| 8.0.0+ | N/A | N/A | ||
138-
| 7.3.0+ | N/A | N/A || |
139-
| 7.0.0+ | | | ||
140-
| 6.3.0+ || |||
135+
| | 2.10.0 | 3.0.0 | 3.3.0 | 3.7.0 |
136+
|--------|:------:|:-----:|:-----:|:-----:|
137+
| 8.4.0+ | | | ||
138+
| 8.0.0+ | | || |
139+
| 7.3.0+ | || ||
140+
| 7.0.0+ | | |||
141141

142142
If you got a `resolve conflict` error when running `flutter pub get`,
143143
please use `dependency_overrides` to fix it.

example/lib/customs/custom_picker_page.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class _MethodListView extends StatelessWidget {
124124
const SizedBox(height: 5),
125125
Text(
126126
model.description,
127-
style: Theme.of(context).textTheme.caption,
127+
style: Theme.of(context).textTheme.bodySmall,
128128
overflow: TextOverflow.fade,
129129
),
130130
],

example/lib/customs/pickers/directory_file_asset_picker.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -808,8 +808,8 @@ class FileAssetPickerBuilder
808808
: textDelegate.confirm,
809809
style: TextStyle(
810810
color: provider.isSelectedNotEmpty
811-
? theme.textTheme.bodyText1?.color
812-
: theme.textTheme.caption?.color,
811+
? theme.textTheme.bodyLarge?.color
812+
: theme.textTheme.bodySmall?.color,
813813
fontSize: 17.0,
814814
fontWeight: FontWeight.normal,
815815
),
@@ -1066,7 +1066,7 @@ class FileAssetPickerBuilder
10661066
style: TextStyle(
10671067
color: isSelectedNotEmpty
10681068
? null
1069-
: theme.textTheme.caption?.color,
1069+
: theme.textTheme.bodySmall?.color,
10701070
fontSize: 18.0,
10711071
),
10721072
);
@@ -1129,7 +1129,7 @@ class FileAssetPickerBuilder
11291129
'${index + 1}',
11301130
style: TextStyle(
11311131
color: isSelected
1132-
? theme.textTheme.bodyText1?.color
1132+
? theme.textTheme.bodyLarge?.color
11331133
: null,
11341134
fontSize: isAppleOS ? 16.0 : 14.0,
11351135
fontWeight: isAppleOS
@@ -1493,8 +1493,8 @@ class FileAssetPickerViewerBuilderDelegate
14931493
style: TextStyle(
14941494
color: () {
14951495
return provider.isSelectedNotEmpty
1496-
? themeData.textTheme.bodyText1?.color
1497-
: themeData.textTheme.caption?.color;
1496+
? themeData.textTheme.bodyLarge?.color
1497+
: themeData.textTheme.bodySmall?.color;
14981498
}(),
14991499
fontSize: 17.0,
15001500
fontWeight: FontWeight.normal,

example/lib/customs/pickers/insta_asset_picker.dart

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,6 @@ class InstaAssetPickerBuilder extends DefaultAssetPickerBuilderDelegate {
297297
final ValueNotifier<AssetEntity?> _previewAsset =
298298
ValueNotifier<AssetEntity?>(null);
299299

300-
@override
301-
void initState(AssetPickerState<AssetEntity, AssetPathEntity> state) {
302-
super.initState(state);
303-
}
304-
305300
@override
306301
void dispose() {
307302
if (!keepScrollOffset) {
@@ -684,8 +679,10 @@ class InstaAssetPickerBuilder extends DefaultAssetPickerBuilderDelegate {
684679
height: _kIndicatorSize,
685680
padding: const EdgeInsets.all(2),
686681
decoration: BoxDecoration(
687-
border: Border.all(color: theme.selectedRowColor),
688-
color: isSelected ? themeColor : theme.selectedRowColor.withOpacity(.2),
682+
border: Border.all(color: theme.unselectedWidgetColor),
683+
color: isSelected
684+
? themeColor
685+
: theme.unselectedWidgetColor.withOpacity(.2),
689686
shape: BoxShape.circle,
690687
),
691688
child: FittedBox(
@@ -714,8 +711,8 @@ class InstaAssetPickerBuilder extends DefaultAssetPickerBuilderDelegate {
714711
duration: switchingPathDuration,
715712
padding: const EdgeInsets.all(4),
716713
color: isPreview
717-
? theme.selectedRowColor.withOpacity(.5)
718-
: theme.backgroundColor.withOpacity(.1),
714+
? theme.unselectedWidgetColor.withOpacity(.5)
715+
: theme.colorScheme.background.withOpacity(.1),
719716
child: Align(
720717
alignment: AlignmentDirectional.topEnd,
721718
child: isSelected && !isSingleAssetMode

example/lib/customs/pickers/multi_tabs_assets_picker.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,8 +408,8 @@ class MultiTabAssetPickerBuilder extends DefaultAssetPickerBuilderDelegate {
408408
: textDelegate.confirm,
409409
style: TextStyle(
410410
color: p.isSelectedNotEmpty
411-
? theme.textTheme.bodyText1?.color
412-
: theme.textTheme.caption?.color,
411+
? theme.textTheme.bodyLarge?.color
412+
: theme.textTheme.bodySmall?.color,
413413
fontSize: 17,
414414
fontWeight: FontWeight.normal,
415415
),

example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ class NoGlowScrollBehavior extends ScrollBehavior {
5959
const NoGlowScrollBehavior();
6060

6161
@override
62-
Widget buildViewportChrome(
62+
Widget buildOverscrollIndicator(
6363
BuildContext context,
6464
Widget child,
65-
AxisDirection axisDirection,
65+
ScrollableDetails details,
6666
) =>
6767
child;
6868
}

example/lib/pages/home_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ class _HomePageState extends State<HomePage> {
7676
sortKey: const OrdinalSortKey(0),
7777
child: Text(
7878
'WeChat Asset Picker',
79-
style: Theme.of(context).textTheme.headline6,
79+
style: Theme.of(context).textTheme.titleLarge,
8080
),
8181
),
8282
Semantics(
8383
sortKey: const OrdinalSortKey(0.1),
8484
child: Text(
8585
'Version: ${packageVersion ?? 'unknown'}',
86-
style: Theme.of(context).textTheme.caption,
86+
style: Theme.of(context).textTheme.bodySmall,
8787
),
8888
),
8989
],

example/lib/widgets/method_list_view.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class _MethodListViewState extends State<MethodListView> {
6464
const SizedBox(height: 5),
6565
Text(
6666
model.description,
67-
style: Theme.of(context).textTheme.caption,
67+
style: Theme.of(context).textTheme.bodySmall,
6868
),
6969
],
7070
),

0 commit comments

Comments
 (0)