material-foundation / material-foundation/flutter-packages
Migrate deprecated CorePalette / Scheme APIs to CorePalettes + DynamicScheme
Open
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:
- Material 3 has introduced user-controlled color contrast which allows users to select three levels of contrast:
- According to the linked specification, the color scheme should "automatically" inherit the system contrast settings. However, the
dynamic_colorplugin does not respect this setting. The colors provided by the plugin are always the same irrespective of the contrast setting.
Steps to reproduce:
- Create a Flutter app and add the
dynamic_colorpackage. - Use
DynamicColorBuilderto get the light and dark color schemes. - Run the app on Android where the contrast setting is supported. To change the contrast, go to Developer Options > Contrast.
- After changing the contrast, open another app where dynamic color is supported like Google Drive to observe the differences.
- Reopen the Flutter app. It can be observed that the colors do not change as per the selected contrast option.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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