Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Color.withOpacity with Color.withValues (Resolves #2437) #2458

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

angelosilvestre
Copy link
Collaborator

Replace Color.withOpacity with Color.withValues. Resolves #2437

The CI is failing on the super_text_layout analysis due to Color.withOpacity being deprecated:

Analyzing super_text_layout...                                  

   info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • example/lib/main.dart:254:71 • deprecated_member_use
   info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • example/lib/main.dart:4[8](https://github.com/superlistapp/super_editor/actions/runs/12129129760/job/33816940663?pr=2436#step:5:9)4:21 • deprecated_member_use
   info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • example/lib/main.dart:502:30 • deprecated_member_use
   info • 'withOpacity' is deprecated and shouldn't be used. Use .withValues() to avoid precision loss • lib/src/caret_layer.dart:182:42 • deprecated_member_use

To migrate, all we need is to replace calls to withOpacity to withValues passing the opacity as the alpha argument.

Source: https://docs.flutter.dev/release/breaking-changes/wide-gamut-framework#opacity

Copy link
Contributor

@matthew-carroll matthew-carroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matthew-carroll matthew-carroll merged commit 16b4b21 into main Dec 20, 2024
10 of 14 checks passed
@matthew-carroll matthew-carroll deleted the 2437_replace-deprecated-api branch December 20, 2024 01:10
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.

Replace Color.withOpacity with Color.withValues
2 participants