-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Proposal] Better support for ThemeExtensions #93
Comments
@bdlukaa will review in detail. A few things to consider is that Mix should not be dependent on only Material design tokens, they also will need to be able to use them and/or create custom ones for their own design system. |
@bdlukaa I like this approach and could simplify a lot of our theming logic. I wonder if we can use this for spacing, sizes and so on. Could you do a POC for the Space theme data, and we can validate the implementation |
@bdlukaa while taking a closer look into this, I don't think ThemeExtensions replace the Mix Tokens, especially if you are trying to accomplish something like |
We have rewritten large parts of Mix, which better supports a lot of Material Theme features. However, I have renamed this to highlight better support for ThemeExtensions. |
We can take advantage of Material's theme extensions to replace the current mix theming. Currently, we define global variables and attach value to them in a
MixThemeData
, so that we can use globally.Proposal
A callback based function
theme<T extends ThemeExtension>((T))
that can be called inside aMix
. The mixer will look into every attribute for atheme
and perform the operation based on the current context.Something like:
Other things I have considered
Making
theme
more readable and usable with something likeBut I can't seem to find a way where
theme
would have access to the current contextAdditional context
https://api.flutter.dev/flutter/material/ThemeData/extensions.html
The text was updated successfully, but these errors were encountered: