Skip to content

Commit 955fd5d

Browse files
srawlinsdkwingsmt
andauthored
[material_ui] Use super parameters in more places (flutter#12460)
This is work towards dart-lang/sdk#59226 The lint rule use_super_parameters has a bug such that it didn't previously report these cases. But they will be reported soon. ## Pre-Review Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] page, which explains my responsibilities. - [x] I read and followed the [relevant style guides] and ran [the auto-formatter]. - [x] I signed the [CLA]. - [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g. `[shared_preferences]` - [x] I [linked to at least one issue that this PR fixes] in the description above. - [x] I followed [the version and CHANGELOG instructions], using [semantic versioning] and the [repository CHANGELOG style], or I have commented below to indicate which documented exception this PR falls under[^1]. - [x] I updated/added any relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or I have commented below to indicate which [test exemption] this PR falls under[^1]. - [x] All existing and new tests are passing. Test exempt, as this code is covered by existing static and runtime checks. <!-- Links --> [Contributor Guide]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [Tree Hygiene]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md [relevant style guides]: https://github.com/flutter/packages/blob/main/CONTRIBUTING.md#style [the auto-formatter]: https://github.com/flutter/packages/blob/main/script/tool/README.md#format-code [CLA]: https://cla.developers.google.com/ [Discord]: https://github.com/flutter/flutter/blob/master/docs/contributing/Chat.md [linked to at least one issue that this PR fixes]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#overview [the version and CHANGELOG instructions]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#version-and-changelog-updates [semantic versioning]: https://dart.dev/tools/pub/versioning#semantic-versions [repository CHANGELOG style]: https://github.com/flutter/flutter/blob/master/docs/ecosystem/contributing/README.md#changelog-style [test exemption]: https://github.com/flutter/flutter/blob/master/docs/contributing/Tree-hygiene.md#tests --------- Co-authored-by: Tong Mu <[email protected]>
1 parent b99325b commit 955fd5d

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

‎packages/material_ui/lib/src/drawer.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ class DrawerController extends StatefulWidget {
339339
///
340340
/// The [child] argument is typically a [Drawer].
341341
const DrawerController({
342-
GlobalKey? key,
342+
GlobalKey? super.key,
343343
required this.child,
344344
required this.alignment,
345345
this.isDrawerOpen = false,
@@ -349,7 +349,7 @@ class DrawerController extends StatefulWidget {
349349
this.edgeDragWidth,
350350
this.enableOpenDragGesture = true,
351351
this.drawerBarrierDismissible = true,
352-
}) : super(key: key);
352+
});
353353

354354
/// The widget below this widget in the tree.
355355
///

‎packages/material_ui/lib/src/dropdown_menu_form_field.dart‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ class DropdownMenuFormField<T> extends FormField<T> {
7474
MenuController? menuController,
7575
super.restorationId,
7676
super.onSaved,
77-
AutovalidateMode autovalidateMode = AutovalidateMode.disabled,
77+
super.autovalidateMode = AutovalidateMode.disabled,
7878
super.validator,
7979
super.forceErrorText,
8080
super.errorBuilder,
8181
}) : super(
8282
initialValue: initialSelection,
83-
autovalidateMode: autovalidateMode,
8483
builder: (FormFieldState<T> field) {
8584
final state = field as _DropdownMenuFormFieldState<T>;
8685

‎packages/material_ui/lib/src/input_decorator.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class _InputBorderTween extends Tween<InputBorder> {
113113
// Passes the _InputBorderGap parameters along to an InputBorder's paint method.
114114
class _InputBorderPainter extends CustomPainter {
115115
_InputBorderPainter({
116-
required Listenable repaint,
116+
required super.repaint,
117117
required this.borderAnimation,
118118
required this.border,
119119
required this.gapAnimation,
@@ -122,7 +122,7 @@ class _InputBorderPainter extends CustomPainter {
122122
required this.fillColor,
123123
required this.hoverAnimation,
124124
required this.hoverColorTween,
125-
}) : super(repaint: repaint);
125+
});
126126

127127
final Animation<double> borderAnimation;
128128
final _InputBorderTween border;

‎packages/material_ui/test/will_pop_test.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class _TestPageRoute<T> extends MaterialPageRoute<T> {
7070
}
7171

7272
class _TestPage extends Page<dynamic> {
73-
_TestPage({required this.builder, required LocalKey key}) : _key = GlobalKey(), super(key: key);
73+
_TestPage({required this.builder, required LocalKey super.key}) : _key = GlobalKey();
7474

7575
final WidgetBuilder builder;
7676
final GlobalKey<dynamic> _key;

0 commit comments

Comments
 (0)