dynamic_widget icon indicating copy to clipboard operation
dynamic_widget copied to clipboard

add support for parsing theme color

Open hellkun opened this issue 3 years ago • 1 comments

Hi there, thanks you making this great package.

In my experience, it's rather difficult to make the color of texts suitable for both light and dark theme. For example, texts of deep grey look good on light theme, but hardly readable on dark theme. Maybe we could support apply colors defined in colorScheme, e.g. primary, onPrimary, surface, onSurface, etc, to keep the same level of readability regradless of which theme is applied.

This PR might have a workaround for use cases like above, which defines a mapping for themed color, like:

  • ::primary -> colorScheme.primary
  • ::onPrimary -> colorScheme.onPrimary
  • ::surface -> colorScheme.surface
  • ::onSurface -> colorScheme.onSurface ...

There's also limitation: The exported json has to be manually modified, as the code has not idea about the developer's intention (a constant hex color, or a color picked from colorScheme)

hellkun avatar Mar 10 '21 07:03 hellkun

Missing concrete implementations of 'WidgetParser.export' and 'getter WidgetParser.widgetType'. any solution for this error?

yashmittalJTG avatar Apr 29 '21 13:04 yashmittalJTG