Skip to content

Make color recognition more specific#8824

Merged
helin24 merged 4 commits into
flutter:mainfrom
helin24:color
Feb 25, 2026
Merged

Make color recognition more specific#8824
helin24 merged 4 commits into
flutter:mainfrom
helin24:color

Conversation

@helin24
Copy link
Copy Markdown
Member

@helin24 helin24 commented Feb 24, 2026

Fixes #7184

To manually test, check that the sample code with a non-color does not generate a color box:

Screenshot 2026-02-24 at 9 29 04 AM

(TestEnum.blue has no color box, but Colors.blue does)

Copy link
Copy Markdown
Contributor

@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 aims to refine color recognition in the Flutter IntelliJ plugin by adding checks to ensure that the color being resolved is indeed a Flutter color (either Colors or CupertinoColors). This prevents the color provider from incorrectly resolving colors from other sources. The changes involve adding regular expression matching to verify the color's origin, enhancing the specificity of the color recognition process.

Comment thread src/io/flutter/editor/FlutterColorProvider.java Outdated
Comment thread src/io/flutter/editor/FlutterColorProvider.java Outdated
helin24 and others added 2 commits February 24, 2026 09:25
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@helin24 helin24 requested a review from pq February 24, 2026 17:26
@helin24
Copy link
Copy Markdown
Member Author

helin24 commented Feb 24, 2026

I'm ambivalent about whether to land this; see more details in the linked issue. It seems harmless and low cost enough so 🤷 .

Copy link
Copy Markdown
Collaborator

@pq pq left a comment

Choose a reason for hiding this comment

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

LGTM!

@helin24 helin24 merged commit d1bca1a into flutter:main Feb 25, 2026
8 checks passed
@helin24 helin24 deleted the color branch February 25, 2026 04:56
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.

Problem with Color Cues

2 participants