Skip to content

Commit 4b96a53

Browse files
authored
🚀 Loosen version constraints (#92)
1 parent aab2011 commit 4b96a53

10 files changed

+30
-26
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ that can be found in the LICENSE file. -->
44

55
# Changelog
66

7-
## 3.2.0
7+
## 3.2.0+1
88

9-
Migrate to Flutter 3, drop supports for previous Flutter versions.
9+
### New features
10+
11+
- Support Flutter 3.
1012

1113
## 3.1.0
1214

analysis_options.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ linter:
229229
- use_rethrow_when_possible
230230
- use_setters_to_change_properties
231231
# - use_string_buffers # has false positives: https://github.com/dart-lang/sdk/issues/34182
232-
- use_super_parameters
233232
- use_test_throws_matchers
234233
# - use_to_and_as_if_applicable # has false positives, so we prefer to catch this by code-review
235234
- valid_regexps

example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void main() {
1717
}
1818

1919
class MyApp extends StatelessWidget {
20-
const MyApp({super.key});
20+
const MyApp({Key? key}) : super(key: key);
2121

2222
@override
2323
Widget build(BuildContext context) {
@@ -34,7 +34,7 @@ class MyApp extends StatelessWidget {
3434
}
3535

3636
class MyHomePage extends StatefulWidget {
37-
const MyHomePage({super.key});
37+
const MyHomePage({Key? key}) : super(key: key);
3838

3939
@override
4040
State<MyHomePage> createState() => _MyHomePageState();

example/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version: 3.2.0+10
44
publish_to: none
55

66
environment:
7-
sdk: '>=2.17.0 <3.0.0'
8-
flutter: '>=3.0.0'
7+
sdk: ">=2.14.0 <3.0.0"
8+
flutter: ">=2.5.0"
99

1010
dependencies:
1111
flutter:

lib/src/widgets/builder/tween_animation_builder_2.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import 'package:flutter/material.dart';
66

77
class TweenAnimationBuilder2<A, B> extends StatelessWidget {
88
const TweenAnimationBuilder2({
9-
super.key,
9+
Key? key,
1010
required this.firstTween,
1111
required this.secondTween,
1212
required this.builder,
1313
this.firstTweenDuration = kThemeAnimationDuration,
1414
this.secondTweenDuration = kThemeAnimationDuration,
1515
this.firstTweenCurve = Curves.linear,
1616
this.secondTweenCurve = Curves.linear,
17-
});
17+
}) : super(key: key);
1818

1919
final Tween<A> firstTween;
2020
final Tween<B> secondTween;

lib/src/widgets/camera_picker.dart

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import 'dart:async';
77
import 'dart:io';
88
import 'dart:math' as math;
99

10+
import 'package:bindings_compatible/bindings_compatible.dart';
1011
import 'package:camera/camera.dart';
1112
import 'package:flutter/gestures.dart';
1213
import 'package:flutter/material.dart';
@@ -36,9 +37,9 @@ const Duration _kDuration = Duration(milliseconds: 300);
3637
/// 该选择器可以通过拍照创建 [AssetEntity]
3738
class CameraPicker extends StatefulWidget {
3839
CameraPicker({
39-
super.key,
40+
Key? key,
4041
this.pickerConfig = const CameraPickerConfig(),
41-
}) {
42+
}) : super(key: key) {
4243
// Set text delegate accordingly.
4344
if (pickerConfig.textDelegate != null) {
4445
Constants.textDelegate = pickerConfig.textDelegate!;
@@ -278,7 +279,7 @@ class CameraPickerState extends State<CameraPicker>
278279
@override
279280
void initState() {
280281
super.initState();
281-
WidgetsBinding.instance.addObserver(this);
282+
useWidgetsBinding().addObserver(this);
282283

283284
// TODO(Alex): Currently hide status bar will cause the viewport shaking on Android.
284285
/// Hide system status bar automatically when the platform is not Android.
@@ -295,7 +296,7 @@ class CameraPickerState extends State<CameraPicker>
295296
if (!Platform.isAndroid) {
296297
SystemChrome.setEnabledSystemUIOverlays(SystemUiOverlay.values);
297298
}
298-
WidgetsBinding.instance.removeObserver(this);
299+
useWidgetsBinding().removeObserver(this);
299300
_controller?.dispose();
300301
_currentExposureOffset.dispose();
301302
_lastExposurePoint.dispose();
@@ -372,7 +373,7 @@ class CameraPickerState extends State<CameraPicker>
372373
});
373374
// **IMPORTANT**: Push methods into a post frame callback, which ensures the
374375
// controller has already unbind from widgets.
375-
WidgetsBinding.instance.addPostFrameCallback((_) async {
376+
useWidgetsBinding().addPostFrameCallback((_) async {
376377
// Dispose at last to avoid disposed usage with assertions.
377378
await c?.dispose();
378379

lib/src/widgets/camera_picker_viewer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import 'camera_picker.dart';
2020

2121
class CameraPickerViewer extends StatefulWidget {
2222
const CameraPickerViewer({
23-
super.key,
23+
Key? key,
2424
required this.pickerState,
2525
required this.pickerType,
2626
required this.previewXFile,
@@ -29,7 +29,7 @@ class CameraPickerViewer extends StatefulWidget {
2929
this.shouldAutoPreviewVideo = false,
3030
this.onEntitySaving,
3131
this.onError,
32-
});
32+
}) : super(key: key);
3333

3434
/// State of the picker.
3535
/// 选择器的状态实例

lib/src/widgets/circular_progress_bar.dart

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

55
import 'dart:math' as math;
66

7+
import 'package:bindings_compatible/bindings_compatible.dart';
78
import 'package:flutter/material.dart';
89

910
import '../constants/styles.dart';
1011

1112
class CircularProgressBar extends StatefulWidget {
1213
const CircularProgressBar({
13-
super.key,
14+
Key? key,
1415
required this.outerRadius,
1516
required this.ringsWidth,
1617
this.ringsColor = C.themeColor,
1718
this.progress = 0.0,
1819
this.duration = const Duration(seconds: 15),
19-
});
20+
}) : super(key: key);
2021

2122
final double outerRadius;
2223
final double ringsWidth;
@@ -40,7 +41,7 @@ class _CircleProgressState extends State<CircularProgressBar>
4041
@override
4142
void initState() {
4243
super.initState();
43-
WidgetsBinding.instance.addPostFrameCallback((Duration _) {
44+
useWidgetsBinding().addPostFrameCallback((Duration _) {
4445
progressController.forward();
4546
});
4647
}

lib/src/widgets/exposure_point_widget.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import 'builder/tween_animation_builder_2.dart';
88

99
class ExposurePointWidget extends StatelessWidget {
1010
const ExposurePointWidget({
11-
super.key,
11+
Key? key,
1212
required this.size,
1313
required this.color,
14-
});
14+
}) : super(key: key);
1515

1616
final double size;
1717
final Color color;

pubspec.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
name: wechat_camera_picker
22
description: A camera picker which is an extension to wechat_assets_picker, but can be run separately.
3-
version: 3.2.0
3+
version: 3.2.0+1
44
homepage: https://github.com/fluttercandies/flutter_wechat_camera_picker
55

66
environment:
7-
sdk: '>=2.17.0 <3.0.0'
8-
flutter: '>=3.0.0'
7+
sdk: ">=2.14.0 <3.0.0"
8+
flutter: ">=2.5.0"
99

1010
dependencies:
1111
flutter:
1212
sdk: flutter
1313

14+
bindings_compatible: ^1.0.1
1415
camera: ^0.9.4+21
1516
path: ^1.8.0
1617
path_provider: ^2.0.8
17-
photo_manager: ^2.1.0+1
18-
video_player: ^2.4.0
18+
photo_manager: ^2.1.0+2
19+
video_player: ^2.3.2

0 commit comments

Comments
 (0)