material-foundation / material-foundation/flutter-packages

Migrate deprecated CorePalette / Scheme APIs to CorePalettes + DynamicScheme

Open
#363 5 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

p: dynamic_color
Dominant language
Dart
Stars
863
Forks
175
PR merge metrics
No merged PRs in 30d

Description

Package

dynamic_color

Description

Migrate from depprecated APIs

  • CorePalette.fromList
  • Scheme.lightFromCorePalette
  • Scheme.darkFromCorePalette

to

  • CorePalettes
  • DynamicScheme (and concrete implementations like SchemeTonalSpot
Contrast

In doing so, we'll also be able to leverage Material's / Android's multi-level contrast:

Expected vs actual result:
  1. Material 3 has introduced user-controlled color contrast which allows users to select three levels of contrast:
    image
  2. According to the linked specification, the color scheme should "automatically" inherit the system contrast settings. However, the dynamic_color plugin does not respect this setting. The colors provided by the plugin are always the same irrespective of the contrast setting.
Steps to reproduce:
  1. Create a Flutter app and add the dynamic_color package.
  2. Use DynamicColorBuilder to get the light and dark color schemes.
  3. Run the app on Android where the contrast setting is supported. To change the contrast, go to Developer Options > Contrast.
  4. After changing the contrast, open another app where dynamic color is supported like Google Drive to observe the differences.
  5. Reopen the Flutter app. It can be observed that the colors do not change as per the selected contrast option.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the dynamic_color package's DynamicColorBuilder entry point and the Android contrast-setting reproduction described here. Trace how light and dark schemes are obtained, then verify the migration uses CorePalettes and DynamicScheme implementations and that the resulting colors vary across the supported contrast levels.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, dart, flutter
Domain
design, mobile-dev
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.