Skip to content

Commit 789e3a7

Browse files
[various] Align Flutter and Dart SDK constraints (#3349)
As described in flutter/flutter#121684, we currently have inconsistencies between Flutter SDK constraints and Dart SDK constraints; we have often updated only the former. This PR: 1. Adds CI enforcement via the repo tooling that the minimum versions are consistent. 2. Adds a new repo tooling command to update SDK constraints, to help mass-fix all the violations of the new enforcement in step 1 (and for future mass changes, such as when we update our test matrix and mass-drop support for versions that are no longe tested). - In all cases, the looser constraint was updated to match the more restrictive constraint, such that there's no actual change in what Flutter version any package actually supports. 3. Runs `dart fix --apply` over all changed packages to automatically fix all of the analysis failures caused by step 2 suddenly making all of our packages able to use `super` parameters. Fixes flutter/flutter#121684 Fixes flutter/flutter#121685
1 parent f14fae7 commit 789e3a7

File tree

496 files changed

+1363
-838
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

496 files changed

+1363
-838
lines changed

.cirrus.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ task:
9595
always:
9696
format_script: ./script/tool_runner.sh format --fail-on-change
9797
license_script: $PLUGIN_TOOL_COMMAND license-check
98-
# The major and minor versions here should match the lowest version
98+
# The major and minor version here should match the lowest version
9999
# analyzed in legacy_version_analyze.
100-
pubspec_script: ./script/tool_runner.sh pubspec-check --min-min-flutter-version=3.0.0 --min-min-dart-version=2.17.0
100+
pubspec_script: ./script/tool_runner.sh pubspec-check --min-min-flutter-version=3.0.0
101101
readme_script:
102102
- ./script/tool_runner.sh readme-check
103103
# Re-run with --require-excerpts, skipping packages that still need

packages/animations/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## NEXT
2+
3+
* Aligns Dart and Flutter SDK constraints.
4+
15
## 2.0.7
26
* Updates screenshots to use webp compressed animations
37

packages/animations/example/lib/container_transition.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const double _fabDimension = 56.0;
4141
/// The demo page for [OpenContainerTransform].
4242
class OpenContainerTransformDemo extends StatefulWidget {
4343
/// Creates the demo page for [OpenContainerTransform].
44-
const OpenContainerTransformDemo({Key? key}) : super(key: key);
44+
const OpenContainerTransformDemo({super.key});
4545

4646
@override
4747
State<OpenContainerTransformDemo> createState() {

packages/animations/example/lib/fade_scale_transition.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
88
/// The demo page for [FadeScaleTransition].
99
class FadeScaleTransitionDemo extends StatefulWidget {
1010
/// Creates the demo page for [FadeScaleTransition].
11-
const FadeScaleTransitionDemo({Key? key}) : super(key: key);
11+
const FadeScaleTransitionDemo({super.key});
1212

1313
@override
1414
State<FadeScaleTransitionDemo> createState() =>

packages/animations/example/lib/fade_through_transition.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
88
/// The demo page for [FadeThroughTransition].
99
class FadeThroughTransitionDemo extends StatefulWidget {
1010
/// Creates the demo page for [FadeThroughTransition].
11-
const FadeThroughTransitionDemo({Key? key}) : super(key: key);
11+
const FadeThroughTransitionDemo({super.key});
1212

1313
@override
1414
State<FadeThroughTransitionDemo> createState() =>

packages/animations/example/lib/shared_axis_transition.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import 'package:flutter/material.dart';
88
/// The demo page for [SharedAxisPageTransitionsBuilder].
99
class SharedAxisTransitionDemo extends StatefulWidget {
1010
/// Creates the demo page for [SharedAxisPageTransitionsBuilder].
11-
const SharedAxisTransitionDemo({Key? key}) : super(key: key);
11+
const SharedAxisTransitionDemo({super.key});
1212

1313
@override
1414
State<SharedAxisTransitionDemo> createState() {

packages/animations/example/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ publish_to: none
66
version: 0.0.1
77

88
environment:
9-
sdk: ">=2.12.0 <3.0.0"
9+
sdk: ">=2.17.0 <3.0.0"
1010
flutter: ">=3.0.0"
1111

1212
dependencies:

packages/animations/lib/src/fade_scale_transition.dart

+8-14
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,12 @@ class FadeScaleTransitionConfiguration extends ModalConfiguration {
6565
/// a dismissible barrier. [barrierDismissible] cannot be null. If
6666
/// [barrierDismissible] is true, the [barrierLabel] cannot be null.
6767
const FadeScaleTransitionConfiguration({
68-
Color barrierColor = Colors.black54,
69-
bool barrierDismissible = true,
70-
Duration transitionDuration = const Duration(milliseconds: 150),
71-
Duration reverseTransitionDuration = const Duration(milliseconds: 75),
72-
String barrierLabel = 'Dismiss',
73-
}) : super(
74-
barrierColor: barrierColor,
75-
barrierDismissible: barrierDismissible,
76-
barrierLabel: barrierLabel,
77-
transitionDuration: transitionDuration,
78-
reverseTransitionDuration: reverseTransitionDuration,
79-
);
68+
super.barrierColor = Colors.black54,
69+
super.barrierDismissible = true,
70+
super.transitionDuration = const Duration(milliseconds: 150),
71+
super.reverseTransitionDuration = const Duration(milliseconds: 75),
72+
String super.barrierLabel = 'Dismiss',
73+
});
8074

8175
@override
8276
Widget transitionBuilder(
@@ -115,10 +109,10 @@ class FadeScaleTransition extends StatelessWidget {
115109
/// [animation] is typically an [AnimationController] that drives the transition
116110
/// animation. [animation] cannot be null.
117111
const FadeScaleTransition({
118-
Key? key,
112+
super.key,
119113
required this.animation,
120114
this.child,
121-
}) : super(key: key);
115+
});
122116

123117
/// The animation that drives the [child]'s entrance and exit.
124118
///

packages/animations/lib/src/fade_through_transition.dart

+3-4
Original file line numberDiff line numberDiff line change
@@ -162,12 +162,12 @@ class FadeThroughTransition extends StatelessWidget {
162162
/// The [animation] and [secondaryAnimation] argument are required and must
163163
/// not be null.
164164
const FadeThroughTransition({
165-
Key? key,
165+
super.key,
166166
required this.animation,
167167
required this.secondaryAnimation,
168168
this.fillColor,
169169
this.child,
170-
}) : super(key: key);
170+
});
171171

172172
/// The animation that drives the [child]'s entrance and exit.
173173
///
@@ -213,8 +213,7 @@ class FadeThroughTransition extends StatelessWidget {
213213
}
214214

215215
class _ZoomedFadeInFadeOut extends StatelessWidget {
216-
const _ZoomedFadeInFadeOut({Key? key, required this.animation, this.child})
217-
: super(key: key);
216+
const _ZoomedFadeInFadeOut({required this.animation, this.child});
218217

219218
final Animation<double> animation;
220219
final Widget? child;

packages/animations/lib/src/modal.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ class _ModalRoute<T> extends PopupRoute<T> {
9898
required _ModalTransitionBuilder transitionBuilder,
9999
required this.builder,
100100
RouteSettings? routeSettings,
101-
ui.ImageFilter? filter,
101+
super.filter,
102102
}) : assert(!barrierDismissible || barrierLabel != null),
103103
_transitionBuilder = transitionBuilder,
104-
super(filter: filter, settings: routeSettings);
104+
super(settings: routeSettings);
105105

106106
@override
107107
final Color? barrierColor;

packages/animations/lib/src/open_container.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class OpenContainer<T extends Object?> extends StatefulWidget {
8080
/// All arguments except for [key] must not be null. The arguments
8181
/// [openBuilder] and [closedBuilder] are required.
8282
const OpenContainer({
83-
Key? key,
83+
super.key,
8484
this.closedColor = Colors.white,
8585
this.openColor = Colors.white,
8686
this.middleColor,
@@ -99,7 +99,7 @@ class OpenContainer<T extends Object?> extends StatefulWidget {
9999
this.useRootNavigator = false,
100100
this.routeSettings,
101101
this.clipBehavior = Clip.antiAlias,
102-
}) : super(key: key);
102+
});
103103

104104
/// Background color of the container while it is closed.
105105
///
@@ -341,9 +341,9 @@ class _OpenContainerState<T> extends State<OpenContainer<T?>> {
341341
/// `isVisible` is ignored).
342342
class _Hideable extends StatefulWidget {
343343
const _Hideable({
344-
Key? key,
344+
super.key,
345345
required this.child,
346-
}) : super(key: key);
346+
});
347347

348348
final Widget child;
349349

packages/animations/lib/src/page_transition_switcher.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@ class PageTransitionSwitcher extends StatefulWidget {
168168
/// The [duration], [reverse], and [transitionBuilder] parameters
169169
/// must not be null.
170170
const PageTransitionSwitcher({
171-
Key? key,
171+
super.key,
172172
this.duration = const Duration(milliseconds: 300),
173173
this.reverse = false,
174174
required this.transitionBuilder,
175175
this.layoutBuilder = defaultLayoutBuilder,
176176
this.child,
177-
}) : super(key: key);
177+
});
178178

179179
/// The current child widget to display.
180180
///

packages/animations/lib/src/shared_axis_transition.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ class SharedAxisTransition extends StatelessWidget {
184184
/// The [animation] and [secondaryAnimation] argument are required and must
185185
/// not be null.
186186
const SharedAxisTransition({
187-
Key? key,
187+
super.key,
188188
required this.animation,
189189
required this.secondaryAnimation,
190190
required this.transitionType,
191191
this.fillColor,
192192
this.child,
193-
}) : super(key: key);
193+
});
194194

195195
/// The animation that drives the [child]'s entrance and exit.
196196
///
@@ -472,8 +472,8 @@ class _ExitTransition extends StatelessWidget {
472472
class _FlippedCurveTween extends CurveTween {
473473
/// Creates a vertically flipped [CurveTween].
474474
_FlippedCurveTween({
475-
required Curve curve,
476-
}) : super(curve: curve);
475+
required super.curve,
476+
});
477477

478478
@override
479479
double transform(double t) => 1.0 - super.transform(t);

packages/animations/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+
55
version: 2.0.7
66

77
environment:
8-
sdk: '>=2.12.0 <3.0.0'
8+
sdk: ">=2.17.0 <3.0.0"
99
flutter: ">=3.0.0"
1010

1111
dependencies:

packages/animations/test/dual_transition_builder_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ double _getOpacity(WidgetTester tester) {
281281
}
282282

283283
class _StatefulTestWidget extends StatefulWidget {
284-
const _StatefulTestWidget({Key? key, required this.name}) : super(key: key);
284+
const _StatefulTestWidget({required this.name});
285285

286286
final String name;
287287

packages/animations/test/fade_scale_transition_test.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,9 @@ double _getScale(GlobalKey key, WidgetTester tester) {
466466

467467
class _FlutterLogoModal extends StatefulWidget {
468468
const _FlutterLogoModal({
469-
Key? key,
469+
super.key,
470470
this.name,
471-
}) : super(key: key);
471+
});
472472

473473
final String? name;
474474

packages/animations/test/fade_through_transition_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ class _TestWidget extends StatelessWidget {
487487
}
488488

489489
class _StatefulTestWidget extends StatefulWidget {
490-
const _StatefulTestWidget({Key? key, this.name}) : super(key: key);
490+
const _StatefulTestWidget({super.key, this.name});
491491

492492
final String? name;
493493

packages/animations/test/modal_test.dart

+9-14
Original file line numberDiff line numberDiff line change
@@ -565,9 +565,9 @@ double _getScale(GlobalKey key, WidgetTester tester) {
565565

566566
class _FlutterLogoModal extends StatefulWidget {
567567
const _FlutterLogoModal({
568-
Key? key,
568+
super.key,
569569
this.name,
570-
}) : super(key: key);
570+
});
571571

572572
final String? name;
573573

@@ -593,18 +593,13 @@ class _FlutterLogoModalState extends State<_FlutterLogoModal> {
593593
}
594594

595595
class _TestModalConfiguration extends ModalConfiguration {
596-
_TestModalConfiguration({
597-
Color barrierColor = Colors.green,
598-
bool barrierDismissible = true,
599-
String barrierLabel = 'customLabel',
600-
Duration transitionDuration = const Duration(milliseconds: 300),
601-
Duration reverseTransitionDuration = const Duration(milliseconds: 200),
602-
}) : super(
603-
barrierColor: barrierColor,
604-
barrierDismissible: barrierDismissible,
605-
barrierLabel: barrierLabel,
606-
transitionDuration: transitionDuration,
607-
reverseTransitionDuration: reverseTransitionDuration,
596+
_TestModalConfiguration()
597+
: super(
598+
barrierColor: Colors.green,
599+
barrierDismissible: true,
600+
barrierLabel: 'customLabel',
601+
transitionDuration: const Duration(milliseconds: 300),
602+
reverseTransitionDuration: const Duration(milliseconds: 200),
608603
);
609604

610605
@override

packages/animations/test/open_container_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1933,7 +1933,7 @@ class __RemoveOpenContainerExampleState
19331933
}
19341934

19351935
class DummyStatefulWidget extends StatefulWidget {
1936-
const DummyStatefulWidget({Key? key}) : super(key: key);
1936+
const DummyStatefulWidget({super.key});
19371937

19381938
@override
19391939
State<StatefulWidget> createState() => DummyState();

packages/animations/test/page_transition_switcher_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ void main() {
581581
}
582582

583583
class StatefulTestWidget extends StatefulWidget {
584-
const StatefulTestWidget({Key? key}) : super(key: key);
584+
const StatefulTestWidget({super.key});
585585

586586
@override
587587
StatefulTestWidgetState createState() => StatefulTestWidgetState();

packages/animations/test/shared_axis_transition_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ class _TestWidget extends StatelessWidget {
19311931
}
19321932

19331933
class _StatefulTestWidget extends StatefulWidget {
1934-
const _StatefulTestWidget({Key? key, required this.name}) : super(key: key);
1934+
const _StatefulTestWidget({super.key, required this.name});
19351935

19361936
final String name;
19371937

packages/camera/camera/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## NEXT
2+
3+
* Aligns Dart and Flutter SDK constraints.
4+
15
## 0.10.3+2
26

37
* Updates iOS minimum version in README.

packages/camera/camera/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Future<void> main() async {
114114
/// CameraApp is the Main Application.
115115
class CameraApp extends StatefulWidget {
116116
/// Default Constructor
117-
const CameraApp({Key? key}) : super(key: key);
117+
const CameraApp({super.key});
118118
119119
@override
120120
State<CameraApp> createState() => _CameraAppState();

packages/camera/camera/example/lib/main.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'package:video_player/video_player.dart';
1414
/// Camera example home widget.
1515
class CameraExampleHome extends StatefulWidget {
1616
/// Default Constructor
17-
const CameraExampleHome({Key? key}) : super(key: key);
17+
const CameraExampleHome({super.key});
1818

1919
@override
2020
State<CameraExampleHome> createState() {
@@ -1056,7 +1056,7 @@ class _CameraExampleHomeState extends State<CameraExampleHome>
10561056
/// CameraApp is the Main Application.
10571057
class CameraApp extends StatelessWidget {
10581058
/// Default Constructor
1059-
const CameraApp({Key? key}) : super(key: key);
1059+
const CameraApp({super.key});
10601060

10611061
@override
10621062
Widget build(BuildContext context) {

packages/camera/camera/example/lib/readme_full_example.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Future<void> main() async {
1818
/// CameraApp is the Main Application.
1919
class CameraApp extends StatefulWidget {
2020
/// Default Constructor
21-
const CameraApp({Key? key}) : super(key: key);
21+
const CameraApp({super.key});
2222

2323
@override
2424
State<CameraApp> createState() => _CameraAppState();

packages/camera/camera/example/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Demonstrates how to use the camera plugin.
33
publish_to: none
44

55
environment:
6-
sdk: ">=2.14.0 <3.0.0"
6+
sdk: ">=2.17.0 <3.0.0"
77
flutter: ">=3.0.0"
88

99
dependencies:

packages/camera/camera/lib/src/camera_preview.dart

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import '../camera.dart';
1111
/// A widget showing a live camera preview.
1212
class CameraPreview extends StatelessWidget {
1313
/// Creates a preview widget for the given camera controller.
14-
const CameraPreview(this.controller, {Key? key, this.child})
15-
: super(key: key);
14+
const CameraPreview(this.controller, {super.key, this.child});
1615

1716
/// The controller for the camera that the preview is shown for.
1817
final CameraController controller;

packages/camera/camera/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+
77
version: 0.10.3+2
88

99
environment:
10-
sdk: ">=2.14.0 <3.0.0"
10+
sdk: ">=2.17.0 <3.0.0"
1111
flutter: ">=3.0.0"
1212

1313
flutter:

packages/camera/camera_android/CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## NEXT
22

3+
* Aligns Dart and Flutter SDK constraints.
34
* Updates compileSdkVersion to 33.
45

56
## 0.10.4+1

0 commit comments

Comments
 (0)