Skip to content

Fix deprecated Color API usage causing build failures (#4) - #11

Open
divyanshbhai wants to merge 12 commits into
usarfoss:mainfrom
divyanshbhai:fix-issue-4
Open

Fix deprecated Color API usage causing build failures (#4)#11
divyanshbhai wants to merge 12 commits into
usarfoss:mainfrom
divyanshbhai:fix-issue-4

Conversation

@divyanshbhai

Copy link
Copy Markdown

Fix #4

This PR resolves build failures caused by deprecated Flutter Color API usage in VelocityX.

Changes Made:

  • Color Properties: Replaced deprecated r, g, b, a with red, green, blue, alpha
  • Color Methods: Replaced withValues() with withOpacity()
  • Type References: Fixed CardThemeData to CardTheme

Files Modified:

  • lib/src/extensions/misc_ext.dart
  • lib/src/flutter/animated/animated_container.dart
  • lib/src/flutter/container.dart
  • lib/src/flutter/glass.dart
  • lib/src/velocity_xx.dart
  • lib/src/flutter/velocityx_mixins/neu_mixin.dart
  • lib/src/flutter/universal.dart

Testing:

All deprecated API calls have been replaced with their current equivalents, maintaining full backward compatibility while ensuring builds work with newer Flutter versions.

Divyansh added 12 commits October 15, 2025 18:33
- Replace deprecated r, g, b, a properties with red, green, blue, alpha
- Fix toHex method to use integer values directly
- Update swatch getter to use new color properties
- Fix shadowOutline method in VxAnimatedBox
- Fix shadowOutline method in VxBox
- Replace withValues(alpha: 0.5) with withOpacity(0.5)
- Replace withValues(alpha: 0.3) with withOpacity(0.3) in border color
- Replace withValues(alpha: opacity!) with withOpacity(opacity!) in decoration
- Replace withValues(alpha: 0.24) with withOpacity(0.24) in custom painter
- Replace color.r.toInt() with color.red
- Replace color.g.toInt() with color.green
- Replace color.b.toInt() with color.blue
- Replace color.a.toInt() with color.alpha
- Remove unnecessary toInt() calls as properties are already integers
- Replace baseColor.r.toInt() with baseColor.red
- Replace baseColor.g.toInt() with baseColor.green
- Replace baseColor.b.toInt() with baseColor.blue
- Remove unnecessary toInt() calls as properties are already integers
- Replace CardThemeData with CardTheme as the type is deprecated
- Update cardWidget method to use correct type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Conflict extension (misc.ext) when building

1 participant