Is there a way to access mix theme data outside mix styles ? #225
Answered
by
leoafarias
jean-smaug
asked this question in
Q&A
-
I have a color defined the same way of this doc section const primaryColor = ColorToken('primary');
final theme = MixThemeData(
colors: {
primaryColor: Colors.blue,
},
) I would like to access |
Beta Was this translation helpful? Give feedback.
Answered by
leoafarias
Mar 12, 2024
Replies: 1 comment 3 replies
-
I have something, if it can help someone 🤷♂️ @override
Widget build(BuildContext context) {
var primaryColor = MixTokenResolver(context).colorToken(primaryColor)
// ...
} Is there any risks in terms of performances doing it ? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jean-smaug This is actually something we have been discussing internally. How to resolve styles and/or attributes and not just tokens. I believe this works fine, we will have a bit cleaner implementation that includes attributes also.