Skip to content

Commit

Permalink
Fix withOpacity() deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
JvnSlv committed Dec 11, 2024
1 parent d5145dc commit 97284bb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/widget_toolkit_pin/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ class PinCodeTheme extends ThemeExtension<PinCodeTheme>
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 =
Expand Down Expand Up @@ -159,9 +159,9 @@ class PinCodeTheme extends ThemeExtension<PinCodeTheme>
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 =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class _PinCodeKeyState extends State<PinCodeKey> {
height: _calculateSize(context),
decoration: BoxDecoration(
color: context.pinCodeTheme.pinCodeKeyBackgroundColor
.withOpacity(
widget.isLoading
.withValues(
alpha: widget.isLoading
? 0.1
: isPressed
? 1.0
Expand All @@ -101,7 +101,7 @@ class _PinCodeKeyState extends State<PinCodeKey> {
color: isPressed
? context.pinCodeTheme.pinCodeKeyTextColorPressed
: context.pinCodeTheme.pinCodeKeyTextColorDefault
.withOpacity(widget.isLoading ? 0.5 : 1.0),
.withValues(alpha: widget.isLoading ? 0.5 : 1.0),
),
);

Expand Down

0 comments on commit 97284bb

Please sign in to comment.