Skip to content

Migrate deprecated CorePalette / Scheme APIs to CorePalettes + DynamicScheme #363

Description

@guidezpl

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions