Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

Updates tests that use the deprecated Color.withOpacity to use Color.withValues(alpha:) instead.

Fixes flutter/flutter#159733

Pre-Review Checklist

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Updates tests that use the deprecated `Color.withOpacity` to use
`Color.withValues(alpha:)` instead.

Fixes flutter/flutter#159733
@github-actions github-actions bot added p: two_dimensional_scrollables Issues pertaining to the two_dimensional_scrollables package triage-framework Should be looked at in framework triage labels Nov 26, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly updates the test files to replace the deprecated Color.withOpacity with the recommended Color.withValues(alpha:). The changes are straightforward and address the deprecation as intended. I have added one comment regarding code duplication, suggesting the extraction of a repeated color value into a variable to improve maintainability.

height: 200,
width: 200,
color: Colors.grey.withOpacity(0.5),
color: Colors.grey.withValues(alpha: 0.5),

Choose a reason for hiding this comment

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

medium

This color Colors.grey.withValues(alpha: 0.5) is used four times across two tests in this file. To improve maintainability and reduce duplication, consider extracting it into a final variable at the group level and reusing it.

Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 2, 2025
@auto-submit auto-submit bot merged commit eae2eda into flutter:main Dec 2, 2025
80 checks passed
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Dec 3, 2025
flutter/packages@148dcd2...8cb4903

2025-12-02 [email protected] Remove `no_adjacent_strings_in_list` from
enabled lint rules. (flutter/packages#7878)
2025-12-02 [email protected] Roll Flutter from
05d6005 to 5545bb3 (28 revisions) (flutter/packages#10551)
2025-12-02 [email protected] [two_dimensional_scrollables] Update
test for deprecation (flutter/packages#10525)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
reidbaker pushed a commit to AbdeMohlbi/flutter that referenced this pull request Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: two_dimensional_scrollables Issues pertaining to the two_dimensional_scrollables package triage-framework Should be looked at in framework triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[packages] withOpacity is deprecated

2 participants