Unverified Commit 2230c091 authored by Qun Cheng's avatar Qun Cheng Committed by GitHub

Remove deprecated parameters from `ElevatedButton.styleFrom()`,...

Remove deprecated parameters from `ElevatedButton.styleFrom()`, `OutlinedButton.styleFrom()`, and `TextButton.styleFrom()` (#139267)
parent 9ef1c2b0
......@@ -171,29 +171,14 @@ class ElevatedButton extends ButtonStyleButton {
bool? enableFeedback,
AlignmentGeometry? alignment,
InteractiveInkFeatureFactory? splashFactory,
@Deprecated(
'Use backgroundColor instead. '
'This feature was deprecated after v3.1.0.'
)
Color? primary,
@Deprecated(
'Use foregroundColor instead. '
'This feature was deprecated after v3.1.0.'
)
Color? onPrimary,
@Deprecated(
'Use disabledForegroundColor and disabledBackgroundColor instead. '
'This feature was deprecated after v3.1.0.'
)
Color? onSurface,
}) {
final Color? background = backgroundColor ?? primary;
final Color? disabledBackground = disabledBackgroundColor ?? onSurface?.withOpacity(0.12);
final Color? background = backgroundColor;
final Color? disabledBackground = disabledBackgroundColor;
final MaterialStateProperty<Color?>? backgroundColorProp = (background == null && disabledBackground == null)
? null
: _ElevatedButtonDefaultColor(background, disabledBackground);
final Color? foreground = foregroundColor ?? onPrimary;
final Color? disabledForeground = disabledForegroundColor ?? onSurface?.withOpacity(0.38);
final Color? foreground = foregroundColor;
final Color? disabledForeground = disabledForegroundColor;
final MaterialStateProperty<Color?>? foregroundColorProp = (foreground == null && disabledForeground == null)
? null
: _ElevatedButtonDefaultColor(foreground, disabledForeground);
......
......@@ -158,19 +158,9 @@ class OutlinedButton extends ButtonStyleButton {
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,
}) {
final Color? foreground = foregroundColor ?? primary;
final Color? disabledForeground = disabledForegroundColor ?? onSurface?.withOpacity(0.38);
final Color? foreground = foregroundColor;
final Color? disabledForeground = disabledForegroundColor;
final MaterialStateProperty<Color?>? foregroundColorProp = (foreground == null && disabledForeground == null)
? null
: _OutlinedButtonDefaultColor(foreground, disabledForeground);
......
......@@ -168,19 +168,9 @@ class TextButton extends ButtonStyleButton {
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,
}) {
final Color? foreground = foregroundColor ?? primary;
final Color? disabledForeground = disabledForegroundColor ?? onSurface?.withOpacity(0.38);
final Color? foreground = foregroundColor;
final Color? disabledForeground = disabledForegroundColor;
final MaterialStateProperty<Color?>? foregroundColorProp = (foreground == null && disabledForeground == null)
? null
: _TextButtonDefaultColor(foreground, disabledForeground);
......
......@@ -776,8 +776,8 @@ TimePickerThemeData _timePickerTheme({bool includeInputDecoration = false}) {
final MaterialStateColor materialStateColor = MaterialStateColor.resolveWith(getColor);
return TimePickerThemeData(
backgroundColor: Colors.orange,
cancelButtonStyle: TextButton.styleFrom(primary: Colors.red),
confirmButtonStyle: TextButton.styleFrom(primary: Colors.green),
cancelButtonStyle: TextButton.styleFrom(foregroundColor: Colors.red),
confirmButtonStyle: TextButton.styleFrom(foregroundColor: Colors.green),
hourMinuteTextColor: materialStateColor,
hourMinuteColor: materialStateColor,
dayPeriodTextColor: materialStateColor,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment