The Holes In Flutter 4.0 And Why It Matters
--
There are some big holes in Flutter 4.0 largely due to the Google dev team stretched to covering GWT, Android, and Flutter. And given that Material Design 3 implementation in Flutter will never be fully finished just like Material Design 2, one should know and master the 3rd party solutions that fill those holes. Let me give you a brief look at where the holes are and how to fill them.
The HCT to Material Design Relationship Is An Evolving Relationship
Let me show you some recent additions to the Material Color Utilities package, which is the outside package the Flutter SDK uses to implement that HCT color space:
Right from the changelog at:
https://pub.dev/packages/material_color_utilities/changelog
0.3.0–2023–03–10
Added
Add 4 new components:
contrast: Use Contrast for utility methods
dislike: Use DislikeAnalyzer for checking and fixing universally disliked colors
dynamiccolor: Use DynamicColor and MaterialDynamicColors for colors from a DynamicScheme, that adjust based on UI state (dark theme, style, preferences, contrast requirements, etc.)
temperature: Use TemperatureCache for analogous & complementary colors
scheme: Add DynamicScheme and its subclasses:
SchemeExpressive
SchemeMonochrome
SchemeNeutral
SchemeTonalSpot
SchemeVibrant
SchemeFidelity
SchemeContent
hct: Add inViewingConditions to hct, for color relativity
utilities: Add lstarFromY method, utility to which is the inverse of yFromLstar
Unless you have customizable control of how HCT is used, you will never be able to keep up with how the relationship between HCT and MD3 evolves.
We can fix this by doing two steps:
1. Use the Flex Color Scheme to not only fill the null component themes based on a generated color scheme but also use the underlying imported Flex…