-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Closed
Closed
Copy link
Labels
a: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: null-safetySupport for Dart's null safety featureSupport for Dart's null safety featuref: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
The OutlinedButton.styleFrom is declared as:
flutter/packages/flutter/lib/src/material/outlined_button.dart
Lines 142 to 175 in ccfd14b
| static ButtonStyle styleFrom({ | |
| Color? foregroundColor, | |
| Color? backgroundColor, | |
| Color? disabledForegroundColor, | |
| Color? disabledBackgroundColor, | |
| Color? shadowColor, | |
| Color? surfaceTintColor, | |
| double? elevation, | |
| TextStyle? textStyle, | |
| EdgeInsetsGeometry? padding, | |
| Size? minimumSize, | |
| Size? fixedSize, | |
| Size? maximumSize, | |
| BorderSide? side, | |
| OutlinedBorder? shape, | |
| MouseCursor? enabledMouseCursor, | |
| MouseCursor? disabledMouseCursor, | |
| VisualDensity? visualDensity, | |
| MaterialTapTargetSize? tapTargetSize, | |
| Duration? animationDuration, | |
| bool? enableFeedback, | |
| AlignmentGeometry? alignment, | |
| InteractiveInkFeatureFactory? splashFactory, | |
| @Deprecated( | |
| 'Use foregroundColor instead. ' | |
| 'This feature was deprecated after v3.1.0.' | |
| ) | |
| Color? primary, | |
| @Deprecated( | |
| 'Use disabledForegroundColor instead. ' | |
| 'This feature was deprecated after v3.1.0.' | |
| ) | |
| Color? onSurface, | |
| }) { |
where disabledMouseCursor and enabledMouseCursor are nullable, and have no restriction around it.
But later it is used as:
flutter/packages/flutter/lib/src/material/outlined_button.dart
Lines 189 to 191 in ccfd14b
| final MaterialStateProperty<MouseCursor>? mouseCursor = (enabledMouseCursor == null && disabledMouseCursor == null) | |
| ? null | |
| : _OutlinedButtonDefaultMouseCursor(enabledMouseCursor!, disabledMouseCursor!); |
Both has ! but the condition only excluded the case that both values are null.
So if only one value is given, the code gonna throw.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: null-safetySupport for Dart's null safety featureSupport for Dart's null safety featuref: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.found in release: 3.3Found to occur in 3.3Found to occur in 3.3found in release: 3.7Found to occur in 3.7Found to occur in 3.7frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Type
Projects
Status
Done (PR merged)