Skip to content

Commit 686fd09

Browse files
authored
⚡️ Adapt Flutter 3.3 (#354)
1 parent 4751952 commit 686fd09

File tree

9 files changed

+35
-30
lines changed

9 files changed

+35
-30
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
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.0.2
8+
9+
### Improvements
10+
11+
- Adapt Flutter 3.3. (#354)
12+
713
## 8.0.1
814

915
### Fixes

README-ZH.md

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

103103
### 版本兼容
104104

105-
| | 2.8.0 | 2.10.0 | 3.0.0 |
106-
|--------|:-----:|:------:|:-----:|
107-
| 8.0.0+ | 不适用 | 不适用 ||
108-
| 7.3.0+ | 不适用 | 不适用 ||
109-
| 7.0.0+ ||||
110-
| 6.3.0+ ||||
105+
| | 2.8.0 | 2.10.0 | 3.0.0 | 3.3.0 |
106+
|--------|:-----:|:------:|:-----:|:-----:|
107+
| 8.0.0+ | 不适用 | 不适用 |||
108+
| 7.3.0+ | 不适用 | 不适用 |||
109+
| 7.0.0+ |||||
110+
| 6.3.0+ |||||
111111

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

README.md

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

104104
### Versions compatibility
105105

106-
| | 2.8.0 | 2.10.0 | 3.0.0 |
107-
|--------|:-----:|:------:|:-----:|
108-
| 8.0.0+ | N/A | N/A ||
109-
| 7.3.0+ | N/A | N/A ||
110-
| 7.0.0+ ||||
111-
| 6.3.0+ ||||
106+
| | 2.8.0 | 2.10.0 | 3.0.0 | 3.3.0 |
107+
|--------|:-----:|:------:|:-----:|:-----:|
108+
| 8.0.0+ | N/A | N/A |||
109+
| 7.3.0+ | N/A | N/A |||
110+
| 7.0.0+ |||||
111+
| 6.3.0+ |||||
112112

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

example/lib/customs/pickers/directory_file_asset_picker.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import 'dart:io';
66
import 'dart:math' as math;
7-
import 'dart:typed_data';
7+
import 'dart:typed_data' as typed_data;
88

99
import 'package:flutter/material.dart';
1010
import 'package:flutter/services.dart';
@@ -332,14 +332,14 @@ class FileAssetPickerProvider extends AssetPickerProvider<File, Directory> {
332332
}
333333

334334
@override
335-
Future<Uint8List?> getThumbnailFromPath(PathWrapper<Directory> path) async {
335+
Future<typed_data.Uint8List?> getThumbnailFromPath(PathWrapper<Directory> path) async {
336336
final List<FileSystemEntity> entities =
337337
path.path.listSync().whereType<File>().toList();
338338
currentAssets.clear();
339339
for (final FileSystemEntity entity in entities) {
340340
final String extension = basename(entity.path).split('.').last;
341341
if (entity is File && imagesExtensions.contains(extension)) {
342-
final Uint8List data = await entity.readAsBytes();
342+
final typed_data.Uint8List data = await entity.readAsBytes();
343343
return data;
344344
}
345345
}
@@ -938,7 +938,7 @@ class FileAssetPickerBuilder
938938
}) {
939939
final PathWrapper<Directory> wrapper = list[index];
940940
final Directory path = wrapper.path;
941-
final Uint8List? data = wrapper.thumbnailData;
941+
final typed_data.Uint8List? data = wrapper.thumbnailData;
942942

943943
Widget builder() {
944944
if (data != null) {

example/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: wechat_assets_picker_demo
22
description: The demo project for the wechat_assets_picker package.
3-
version: 8.0.1+22
3+
version: 8.0.2+23
44
publish_to: none
55

66
environment:

lib/src/constants/custom_scroll_physics.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// in the LICENSE file.
44

55
import 'package:flutter/cupertino.dart';
6-
import 'package:flutter/physics.dart';
6+
import 'package:flutter/physics.dart' as physics show SpringDescription;
77

88
class CustomBouncingScrollPhysics extends BouncingScrollPhysics {
99
const CustomBouncingScrollPhysics({
@@ -16,8 +16,8 @@ class CustomBouncingScrollPhysics extends BouncingScrollPhysics {
1616
}
1717

1818
@override
19-
SpringDescription get spring {
20-
return SpringDescription.withDampingRatio(
19+
physics.SpringDescription get spring {
20+
return physics.SpringDescription.withDampingRatio(
2121
mass: 0.5,
2222
stiffness: 400.0,
2323
ratio: 1.1,
@@ -36,8 +36,8 @@ class CustomClampingScrollPhysics extends ClampingScrollPhysics {
3636
}
3737

3838
@override
39-
SpringDescription get spring {
40-
return SpringDescription.withDampingRatio(
39+
physics.SpringDescription get spring {
40+
return physics.SpringDescription.withDampingRatio(
4141
mass: 0.5,
4242
stiffness: 400.0,
4343
ratio: 1.1,

lib/src/delegates/asset_picker_builder_delegate.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
// Use of this source code is governed by an Apache license that can be found
33
// in the LICENSE file.
44

5-
import 'dart:async';
6-
import 'dart:io';
5+
import 'dart:io' show Platform;
76
import 'dart:math' as math;
8-
import 'dart:typed_data';
7+
import 'dart:typed_data' as typed_data;
98
import 'dart:ui' as ui;
109

1110
import 'package:flutter/gestures.dart';
@@ -1785,7 +1784,7 @@ class DefaultAssetPickerBuilderDelegate
17851784
}) {
17861785
final PathWrapper<AssetPathEntity> wrapper = list[index];
17871786
final AssetPathEntity pathEntity = wrapper.path;
1788-
final Uint8List? data = wrapper.thumbnailData;
1787+
final typed_data.Uint8List? data = wrapper.thumbnailData;
17891788

17901789
Widget builder() {
17911790
if (data != null) {

lib/src/models/path_wrapper.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Use of this source code is governed by an Apache license that can be found
33
// in the LICENSE file.
44

5-
import 'dart:typed_data';
5+
import 'dart:typed_data' as typed_data;
66

77
import 'package:flutter/foundation.dart';
88

@@ -39,15 +39,15 @@ class PathWrapper<Path> {
3939
/// See also:
4040
/// * [AssetEntity.thumbnailData] API document:
4141
/// https://pub.dev/documentation/photo_manager/latest/photo_manager/AssetEntity/thumbnailData.html
42-
final Uint8List? thumbnailData;
42+
final typed_data.Uint8List? thumbnailData;
4343

4444
/// Creates a modified copy of the object.
4545
///
4646
/// Explicitly specified fields get the specified value, all other fields get
4747
/// the same value of the current object.
4848
PathWrapper<Path> copyWith({
4949
int? assetCount,
50-
Uint8List? thumbnailData,
50+
typed_data.Uint8List? thumbnailData,
5151
}) {
5252
return PathWrapper<Path>(
5353
path: path,

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: wechat_assets_picker
22
description: An audio/video/image picker in pure Dart which is the same with WeChat, support multi picking.
3-
version: 8.0.1
3+
version: 8.0.2
44
homepage: https://github.com/fluttercandies/flutter_wechat_assets_picker
55

66
environment:

0 commit comments

Comments
 (0)