You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Earlier, given a CorePalette, the way to generate the Material color roles was to use Scheme.lightFromCorePalette and Scheme.darkFromCorePalette.
Currently, since Scheme is deprecated in favor of DynamicScheme, what is the way to generate a DyanamicScheme or to obtain color roles given a CorePalette? Is the CorePalette class still relevant or will it be deprecated?
I'm currently using the dynamic_color package for Dart that obtains a CorePalette from Android systems using DynamicColorPlugin.getCorePalette. However, the DynamicColorBuilder widget uses Scheme.lightFromCorePalette and Scheme.darkFromCorePalette to create the color roles and maps it to the Flutter ColorScheme. The deprecated Scheme class does not have the new surface roles( like surfaceContainer) and the fixed roles (like primaryFixed). Flutter has added these new roles to the ColorScheme class (in the beta release) but the Scheme methods do not assign these color roles. So, when I use these new roles in my app, their colors are always null.
DynamicColorBuilder (from the dynamic_color package) is a simple widget that calls DynamicColorPlugin.getCorePalette and maps it to a flutter ColorScheme. So, I can write my own implementation until the dynamic_color package is updated to use the new DynamicScheme classes. In the meantime, if I obtain the Android platform's CorePalette using DynamicColorPlugin.getCorePalette, how can I convert it to a DynamicScheme and obtain the color roles from it?
The text was updated successfully, but these errors were encountered:
Earlier, given a
CorePalette
, the way to generate the Material color roles was to useScheme.lightFromCorePalette
andScheme.darkFromCorePalette
.Currently, since
Scheme
is deprecated in favor ofDynamicScheme
, what is the way to generate aDyanamicScheme
or to obtain color roles given aCorePalette
? Is theCorePalette
class still relevant or will it be deprecated?I'm currently using the
dynamic_color
package for Dart that obtains aCorePalette
from Android systems usingDynamicColorPlugin.getCorePalette
. However, theDynamicColorBuilder
widget usesScheme.lightFromCorePalette
andScheme.darkFromCorePalette
to create the color roles and maps it to the FlutterColorScheme
. The deprecatedScheme
class does not have the newsurface
roles( likesurfaceContainer
) and thefixed
roles (likeprimaryFixed
). Flutter has added these new roles to theColorScheme
class (in the beta release) but theScheme
methods do not assign these color roles. So, when I use these new roles in my app, their colors are alwaysnull
.DynamicColorBuilder
(from thedynamic_color
package) is a simple widget that callsDynamicColorPlugin.getCorePalette
and maps it to a flutterColorScheme
. So, I can write my own implementation until thedynamic_color
package is updated to use the newDynamicScheme
classes. In the meantime, if I obtain the Android platform'sCorePalette
usingDynamicColorPlugin.getCorePalette
, how can I convert it to aDynamicScheme
and obtain the color roles from it?The text was updated successfully, but these errors were encountered: