context property
The context value from the contextType assigned to this component. The value is passed down from the provider of the same contextType. You can reference context in any of the lifecycle methods including the render function.
If you need multiple context values, consider using multiple consumers instead. Read more: https://reactjs.org/docs/context.html#consuming-multiple-contexts
This only has a value when contextType is set.
Example:
var MyContext = createContext('test');
class MyClass extends react.Component2 {
@override
final contextType = MyContext;
render() {
return react.span({}, [
'${this.context}', // Outputs: 'test'
]);
}
}
Implementation
@override
dynamic context;