diff --git a/packages/flutter/lib/src/material/elevated_button.dart b/packages/flutter/lib/src/material/elevated_button.dart index 7f2bdc2de7f..f91c9a0928d 100644 --- a/packages/flutter/lib/src/material/elevated_button.dart +++ b/packages/flutter/lib/src/material/elevated_button.dart @@ -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? 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? foregroundColorProp = (foreground == null && disabledForeground == null) ? null : _ElevatedButtonDefaultColor(foreground, disabledForeground); diff --git a/packages/flutter/lib/src/material/outlined_button.dart b/packages/flutter/lib/src/material/outlined_button.dart index fcef74461e2..e25cc4bb8b6 100644 --- a/packages/flutter/lib/src/material/outlined_button.dart +++ b/packages/flutter/lib/src/material/outlined_button.dart @@ -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? foregroundColorProp = (foreground == null && disabledForeground == null) ? null : _OutlinedButtonDefaultColor(foreground, disabledForeground); diff --git a/packages/flutter/lib/src/material/text_button.dart b/packages/flutter/lib/src/material/text_button.dart index 43210ef0ba2..687e2a40e70 100644 --- a/packages/flutter/lib/src/material/text_button.dart +++ b/packages/flutter/lib/src/material/text_button.dart @@ -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? foregroundColorProp = (foreground == null && disabledForeground == null) ? null : _TextButtonDefaultColor(foreground, disabledForeground); diff --git a/packages/flutter/test/material/time_picker_theme_test.dart b/packages/flutter/test/material/time_picker_theme_test.dart index f9151c7951c..721989ffb92 100644 --- a/packages/flutter/test/material/time_picker_theme_test.dart +++ b/packages/flutter/test/material/time_picker_theme_test.dart @@ -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,