From 8f3a12f1447b4baad06910eadd48b30a0a95e305 Mon Sep 17 00:00:00 2001 From: Alexandre Ardhuin Date: Fri, 4 Dec 2020 08:42:30 +0100 Subject: [PATCH] fix nullability of parameters with redirecting factory constructors (#71547) --- .../flutter/lib/src/material/flat_button.dart | 42 ++++++++-------- .../lib/src/material/raised_button.dart | 48 +++++++++---------- .../flutter/lib/src/material/typography.dart | 12 ++--- 3 files changed, 51 insertions(+), 51 deletions(-) diff --git a/packages/flutter/lib/src/material/flat_button.dart b/packages/flutter/lib/src/material/flat_button.dart index 03acbe5625..91142aaefe 100644 --- a/packages/flutter/lib/src/material/flat_button.dart +++ b/packages/flutter/lib/src/material/flat_button.dart @@ -176,31 +176,31 @@ class FlatButton extends MaterialButton { /// /// The [icon], [label], and [clipBehavior] arguments must not be null. factory FlatButton.icon({ - Key key, - required VoidCallback onPressed, - VoidCallback onLongPress, - ValueChanged onHighlightChanged, - MouseCursor mouseCursor, - ButtonTextTheme textTheme, - Color textColor, - Color disabledTextColor, - Color color, - Color disabledColor, - Color focusColor, - Color hoverColor, - Color highlightColor, - Color splashColor, - Brightness colorBrightness, - EdgeInsetsGeometry padding, - ShapeBorder shape, + Key? key, + required VoidCallback? onPressed, + VoidCallback? onLongPress, + ValueChanged? onHighlightChanged, + MouseCursor? mouseCursor, + ButtonTextTheme? textTheme, + Color? textColor, + Color? disabledTextColor, + Color? color, + Color? disabledColor, + Color? focusColor, + Color? hoverColor, + Color? highlightColor, + Color? splashColor, + Brightness? colorBrightness, + EdgeInsetsGeometry? padding, + ShapeBorder? shape, Clip clipBehavior, - FocusNode focusNode, + FocusNode? focusNode, bool autofocus, - MaterialTapTargetSize materialTapTargetSize, + MaterialTapTargetSize? materialTapTargetSize, required Widget icon, required Widget label, - double minWidth, - double height, + double? minWidth, + double? height, }) = _FlatButtonWithIcon; @override diff --git a/packages/flutter/lib/src/material/raised_button.dart b/packages/flutter/lib/src/material/raised_button.dart index dad6fccffa..e214ab8362 100644 --- a/packages/flutter/lib/src/material/raised_button.dart +++ b/packages/flutter/lib/src/material/raised_button.dart @@ -196,31 +196,31 @@ class RaisedButton extends MaterialButton { /// The [elevation], [highlightElevation], [disabledElevation], [icon], /// [label], and [clipBehavior] arguments must not be null. factory RaisedButton.icon({ - Key key, - required VoidCallback onPressed, - VoidCallback onLongPress, - ValueChanged onHighlightChanged, - MouseCursor mouseCursor, - ButtonTextTheme textTheme, - Color textColor, - Color disabledTextColor, - Color color, - Color disabledColor, - Color focusColor, - Color hoverColor, - Color highlightColor, - Color splashColor, - Brightness colorBrightness, - double elevation, - double highlightElevation, - double disabledElevation, - ShapeBorder shape, + Key? key, + required VoidCallback? onPressed, + VoidCallback? onLongPress, + ValueChanged? onHighlightChanged, + MouseCursor? mouseCursor, + ButtonTextTheme? textTheme, + Color? textColor, + Color? disabledTextColor, + Color? color, + Color? disabledColor, + Color? focusColor, + Color? hoverColor, + Color? highlightColor, + Color? splashColor, + Brightness? colorBrightness, + double? elevation, + double? highlightElevation, + double? disabledElevation, + ShapeBorder? shape, Clip clipBehavior, - FocusNode focusNode, + FocusNode? focusNode, bool autofocus, - EdgeInsetsGeometry padding, - MaterialTapTargetSize materialTapTargetSize, - Duration animationDuration, + EdgeInsetsGeometry? padding, + MaterialTapTargetSize? materialTapTargetSize, + Duration? animationDuration, required Widget icon, required Widget label, }) = _RaisedButtonWithIcon; @@ -276,7 +276,7 @@ class RaisedButton extends MaterialButton { class _RaisedButtonWithIcon extends RaisedButton with MaterialButtonWithIconMixin { _RaisedButtonWithIcon({ Key? key, - required VoidCallback onPressed, + required VoidCallback? onPressed, VoidCallback? onLongPress, ValueChanged? onHighlightChanged, MouseCursor? mouseCursor, diff --git a/packages/flutter/lib/src/material/typography.dart b/packages/flutter/lib/src/material/typography.dart index 87ccd5c6ab..b629b78ee8 100644 --- a/packages/flutter/lib/src/material/typography.dart +++ b/packages/flutter/lib/src/material/typography.dart @@ -96,12 +96,12 @@ class Typography with Diagnosticable { 'This feature was deprecated after v1.13.8.' ) factory Typography({ - TargetPlatform platform, - TextTheme black, - TextTheme white, - TextTheme englishLike, - TextTheme dense, - TextTheme tall, + TargetPlatform? platform, + TextTheme? black, + TextTheme? white, + TextTheme? englishLike, + TextTheme? dense, + TextTheme? tall, }) = Typography.material2014; /// Creates a typography instance using material design's 2014 defaults.