Skip to content

Conversation

@davidmartos96
Copy link
Contributor

@davidmartos96 davidmartos96 commented Dec 23, 2023

The following PR adjusts the usage of the Material 3 tokens for the Filter, Input and Choice chips. In particular, to fix how the label and icon colors are displayed depending on the unselected/selected state.

Fixes #136632

For this PR I had to change a few of the tests in the repo, which were expecting incorrect colors. How is that particular situation handled?

@TahaTesser Just pinging to let you know that the image you provided in the expected results section doesn't seem to be using exactly the tokens from the material specification. In the spec, the leading icon color is "primary" for InputChip (selected) and for unselected ChoiceChip and FilterChip.

Example with contrasting colors from the linked issue:

Primary: Dark green
SecondaryContainer: Light green
OnSecondaryContainer: Blue
OnSurfaceVariant: Red

Before:

Screenshot from 2023-12-23 15-16-20

After:

Screenshot from 2023-12-23 15-16-01

Example with Material 3 default:

Before:

Screenshot from 2023-12-23 16-51-56

After:

Screenshot from 2023-12-23 16-52-06

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Dec 23, 2023
@flutter-dashboard

This comment was marked as resolved.

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label Dec 23, 2023
@TahaTesser TahaTesser self-requested a review January 2, 2024 13:50
TahaTesser

This comment was marked as resolved.

@flutter-dashboard

This comment was marked as resolved.

@flutter-dashboard

This comment was marked as resolved.

TahaTesser

This comment was marked as resolved.

@davidmartos96

This comment was marked as resolved.

TahaTesser

This comment was marked as resolved.

@TahaTesser TahaTesser self-requested a review January 8, 2024 16:12
@TahaTesser

This comment was marked as resolved.

@davidmartos96

This comment was marked as resolved.

@flutter-dashboard

This comment was marked as resolved.

@davidmartos96

This comment was marked as resolved.

@flutter-dashboard

This comment was marked as resolved.

@TahaTesser

This comment was marked as resolved.

@davidmartos96 davidmartos96 force-pushed the fix_chips_select_color branch from a5ae25f to 0cbf9b5 Compare January 11, 2024 09:37
@flutter-dashboard

This comment was marked as resolved.

@TahaTesser TahaTesser force-pushed the fix_chips_select_color branch from 27587de to db6cb10 Compare January 16, 2024 11:43
@flutter-dashboard

This comment was marked as resolved.

@davidmartos96

This comment was marked as resolved.

@davidmartos96 davidmartos96 force-pushed the fix_chips_select_color branch from c0380a1 to ac2ab1f Compare January 23, 2024 09:19
auto-submit bot pushed a commit that referenced this pull request Jan 23, 2024
…ult value is provided (#140872)

Fixes some false positives and false negatives from the `gen_defaults` tool regarding unavailable tokens in the Material spec.

Fixes #140871 

# Before

![image](https://github.com/flutter/flutter/assets/22084723/eb6c43ee-d919-4203-80ee-e36869e5bbcf)

# After

![image](https://github.com/flutter/flutter/assets/22084723/67093dcb-1ab0-439f-9338-a6f364d2a9e1)

These new issues that are logged are being fixed in #140573

---

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
@davidmartos96
Copy link
Contributor Author

@TahaTesser Hello! It has been rebased.
Is it good to merge now?

@TahaTesser
Copy link
Member

TahaTesser commented Jan 30, 2024

Tree is currently down, I'll wait for the tree to go green then merge.

@QuncCccccc
Copy link
Contributor

QuncCccccc commented Jan 30, 2024

FRoB is not reporting TAP failures(Google testing) now because of b/319513492. Let me do a local test for G3 before we merge this in master.

@QuncCccccc QuncCccccc merged commit 20dc5cb into flutter:master Jan 31, 2024
@davidmartos96 davidmartos96 deleted the fix_chips_select_color branch January 31, 2024 09:12
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 1, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Feb 1, 2024
Manual roll requested by [email protected]

flutter/flutter@75a2e5b...c65ab4d

2024-01-31 [email protected] Roll Flutter Engine from 2d2d88068a23 to 8e7df85f7d11 (2 revisions) (flutter/flutter#142583)
2024-01-31 [email protected] Add `DropdownMenu.focusNode` (flutter/flutter#142516)
2024-01-31 [email protected] Marks Windows_android native_assets_android to be unflaky (flutter/flutter#140042)
2024-01-31 [email protected] Marks Linux_pixel_7pro complex_layout_scroll_perf_impeller_gles__timeline_summary to be unflaky (flutter/flutter#140039)
2024-01-31 [email protected] Marks Linux_android native_assets_android to be unflaky (flutter/flutter#140040)
2024-01-31 [email protected] Marks Mac_android native_assets_android to be unflaky (flutter/flutter#140041)
2024-01-31 [email protected] Marks Mac flavors_test_macos to be unflaky (flutter/flutter#140647)
2024-01-31 [email protected] Roll Flutter Engine from 588f06b02664 to 2d2d88068a23 (1 revision) (flutter/flutter#142569)
2024-01-31 [email protected] Roll Flutter Engine from e6e1d6b3d035 to 588f06b02664 (1 revision) (flutter/flutter#142566)
2024-01-31 [email protected] M3 - Fix Chip icon and label colors (flutter/flutter#140573)
2024-01-31 [email protected] Roll Flutter Engine from d20ed240ace9 to e6e1d6b3d035 (3 revisions) (flutter/flutter#142564)
2024-01-30 [email protected] Be less verbose in CI for customer_testing, and revert old timeout hack (flutter/flutter#139611)
2024-01-30 [email protected] use PDI to end the isolated scope for RLI (flutter/flutter#141345)
2024-01-30 [email protected] Style correctness improvements for toStrings and related fixes (flutter/flutter#142485)
2024-01-30 [email protected] Roll Flutter Engine from 500ae6c4d947 to d20ed240ace9 (1 revision) (flutter/flutter#142554)
2024-01-30 49699333+dependabot[bot]@users.noreply.github.com Bump codecov/codecov-action from 3.1.5 to 3.1.6 (flutter/flutter#142553)
2024-01-30 [email protected] Roll Flutter Engine from cd12316a0883 to 500ae6c4d947 (1 revision) (flutter/flutter#142551)
2024-01-30 [email protected] Roll Flutter Engine from 0e4342c5a1f2 to cd12316a0883 (6 revisions) (flutter/flutter#142548)
2024-01-30 [email protected] Roll Flutter Engine from 438e9b4d7d4e to 0e4342c5a1f2 (11 revisions) (flutter/flutter#142543)
2024-01-30 [email protected] Fix: selection handles do not inherit color from local `Theme` widget (flutter/flutter#142476)
2024-01-30 [email protected] Marks Windows_arm64 plugin_test_windows to be unflaky (flutter/flutter#137675)
2024-01-30 [email protected] Revert "Roll Flutter Engine from 0e586d1c28c8 to f02a4a80a77e (3 revisions)" (flutter/flutter#142533)

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
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: 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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chips don't use the correct selected & unselected ColorScheme colors for the icons in Material 3

3 participants