Can't get color theme FlutterFlowTheme.of(context)to work in Function - InvalidType

Custom Code

Context can't be identified or defined in FlutterFlowTheme.of(context) for color map function I'm creating, I've tried a couple things but it just makes it so the "function is empty and cannot be parsed" any idea how to return a them color and fix the context issue? I'm trying to return a color theme and can't seem to fix this issue.

This is the error I get

These are the Quick Fixes and they either do nothing or make it so I can't save the function due to parsing error.

What have you tried so far?

Tried creating local variable, didn't work. Tried creating positional parameter and it created parse errors, mixing does nothing. Cant' include build context in functions with flutter flow. What am I doing wrong or what can I do?

Did you check FlutterFlow's Documentation for this topic?
Yes
1
3 replies