From 97284bbc41e02b3cc30d905368a7753c8383cd7a Mon Sep 17 00:00:00 2001 From: JvnSlv Date: Wed, 11 Dec 2024 20:30:14 +0100 Subject: [PATCH] Fix withOpacity() deprecation --- packages/widget_toolkit_pin/example/lib/main.dart | 2 +- .../base/utils/design_system/design_system_colors.dart | 2 +- .../lib/src/base/utils/theme/pin_code_theme.dart | 8 ++++---- .../ui_components/pin_code_key.dart | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/widget_toolkit_pin/example/lib/main.dart b/packages/widget_toolkit_pin/example/lib/main.dart index 15b154dc..a9fe4cbd 100644 --- a/packages/widget_toolkit_pin/example/lib/main.dart +++ b/packages/widget_toolkit_pin/example/lib/main.dart @@ -22,7 +22,7 @@ class MyApp extends StatelessWidget { colorScheme: ColorScheme.fromSwatch(), extensions: [ PinCodeTheme.light().copyWith( - pinCodeKeyTextColorPressed: Colors.lightBlue.withOpacity(0.5), + pinCodeKeyTextColorPressed: Colors.lightBlue.withValues(alpha:0.5), ), WidgetToolkitTheme.light(), ], diff --git a/packages/widget_toolkit_pin/lib/src/base/utils/design_system/design_system_colors.dart b/packages/widget_toolkit_pin/lib/src/base/utils/design_system/design_system_colors.dart index 40b1bdf8..2c997f95 100644 --- a/packages/widget_toolkit_pin/lib/src/base/utils/design_system/design_system_colors.dart +++ b/packages/widget_toolkit_pin/lib/src/base/utils/design_system/design_system_colors.dart @@ -24,7 +24,7 @@ class DesignSystemColors { scaffoldBackgroundColor = Colors.black, highlightColor = Colors.white, errorTitleColor = Colors.white, - bottomSheetBarrierColor = Colors.black.withOpacity(0.5), + bottomSheetBarrierColor = Colors.black.withValues(alpha: 0.5), shimmerBaseColor = const Color(0xff9da2a6), shimmerHighlightColor = const Color(0xffF0F0F2); diff --git a/packages/widget_toolkit_pin/lib/src/base/utils/theme/pin_code_theme.dart b/packages/widget_toolkit_pin/lib/src/base/utils/theme/pin_code_theme.dart index 9f07cb57..3dbda80b 100644 --- a/packages/widget_toolkit_pin/lib/src/base/utils/theme/pin_code_theme.dart +++ b/packages/widget_toolkit_pin/lib/src/base/utils/theme/pin_code_theme.dart @@ -85,9 +85,9 @@ class PinCodeTheme extends ThemeExtension appBarButtonIconColor = PrimeDesignSystem.light().colors.textColorWhite, shimmerBaseColor = PrimeDesignSystem.light().colors.white, shimmerHighlightColor = - PrimeDesignSystem.light().colors.white.withOpacity(0.4), + PrimeDesignSystem.light().colors.white.withValues(alpha: 0.4), titleButtonIconBorderColor = - PrimeDesignSystem.light().colors.white.withOpacity(0.4), + PrimeDesignSystem.light().colors.white.withValues(alpha: 0.4), pinCodeKeyBackgroundColor = PrimeDesignSystem.light().colors.textColorWhite, pinKeyboardMaskedKeyBorderColor = @@ -159,9 +159,9 @@ class PinCodeTheme extends ThemeExtension appBarButtonIconColor = PrimeDesignSystem.dark().colors.textColorWhite, shimmerBaseColor = PrimeDesignSystem.dark().colors.white, shimmerHighlightColor = - PrimeDesignSystem.dark().colors.white.withOpacity(0.4), + PrimeDesignSystem.dark().colors.white.withValues(alpha: 0.4), titleButtonIconBorderColor = - PrimeDesignSystem.dark().colors.white.withOpacity(0.4), + PrimeDesignSystem.dark().colors.white.withValues(alpha: 0.4), pinCodeKeyBackgroundColor = PrimeDesignSystem.dark().colors.textColorWhite, pinKeyboardMaskedKeyBorderColor = diff --git a/packages/widget_toolkit_pin/lib/src/lib_pin_code_with_biometrics/ui_components/pin_code_key.dart b/packages/widget_toolkit_pin/lib/src/lib_pin_code_with_biometrics/ui_components/pin_code_key.dart index 69b517ef..385f4911 100644 --- a/packages/widget_toolkit_pin/lib/src/lib_pin_code_with_biometrics/ui_components/pin_code_key.dart +++ b/packages/widget_toolkit_pin/lib/src/lib_pin_code_with_biometrics/ui_components/pin_code_key.dart @@ -79,8 +79,8 @@ class _PinCodeKeyState extends State { height: _calculateSize(context), decoration: BoxDecoration( color: context.pinCodeTheme.pinCodeKeyBackgroundColor - .withOpacity( - widget.isLoading + .withValues( + alpha: widget.isLoading ? 0.1 : isPressed ? 1.0 @@ -101,7 +101,7 @@ class _PinCodeKeyState extends State { color: isPressed ? context.pinCodeTheme.pinCodeKeyTextColorPressed : context.pinCodeTheme.pinCodeKeyTextColorDefault - .withOpacity(widget.isLoading ? 0.5 : 1.0), + .withValues(alpha: widget.isLoading ? 0.5 : 1.0), ), );