Migrate to new APIs away from CorePalette/Scheme - #699
Draft
helomri wants to merge 6 commits into
Draft
Conversation
…es as we migrate to using tonal spot instead of unknown legacy variant
Contributor
Author
|
@guidezpl Do you think the error palette could be added to |
# Conflicts: # packages/dynamic_color/example/pubspec.lock # packages/dynamic_color/pubspec.lock # packages/dynamic_color_testing/analysis_options.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This enables developers to generate color schemes with the contrast they want and request specific variants for a dynamic scheme (which unfortunately cannot fully be correct since Android does not expose the necessary information to do that). The error palette is now also fetched from the OS.
CorePalettesdoes not let us store this palette yet, so currently we only work withList<TonalPalette>.Old APIs are deprecated but still working. This lets time for people to adopt the new ones that can eventually be removed.
I have added new pages in the example app to test/demo the new behavior.
Tests
I have added the option to mock the tonal palettes and have also added samples for testing. I have updated an expected value (twice) as
CorePaletteused an unknown palette generation algorithm that is not reproducible using official variants.I did not add tests to check for conversion to a color scheme from a dynamic scheme since the existing testing for conversion only covered retro-compatibility, which we do not have to do anymore.
I have added some dependency overrides to improve the dev environment.
Issues
Fixes #363
Checklist
CHANGELOG.md