maybeOf static method
The state from the closest instance of this class that encloses the given context.
This method is typically used by ArcaneGridState item widgets that insert or remove items in response to user input.
If no ArcaneGridState surrounds the context given, then this function will return null.
This method can be expensive (it walks the element tree).
Implementation
static ArcaneGridState? maybeOf(BuildContext context) {
return context.findAncestorStateOfType<ArcaneGridState>();
}