Include Build context and add imports on functions.

Custom Code

Why can't we add build context or add imports on custom functions? I need functions that return a FlutterFlow ColorTheme, but this is impossible without build context. I also can't do things like generating a UUID from a function, I have to use an action and then get the output and use that. I have tons of conditional values for colors on tons of widgets like text, containers (borders and fill colors), progress bars, and so much more, but I can't simplify with a function and still use FlutterFlow's built in color themes. My project size Is at 88%, and doing this would make my project a lot smaller, since user selected colors per component is needed, but I can't just use a function. Is there any way to do this? or just hope FlutterFlow decides to push an update on this within the next 5 years?

What have you tried so far?

Yes.

Did you check FlutterFlow's Documentation for this topic?
No
2
5 replies