maybeOf static method
- BuildContext context
The AnimatedReorderableState from the closest instance of AnimatedReorderable that encloses the given context.
This method is typically used by AnimatedReorderable item widgets that insert or remove items in response to user input.
If no AnimatedReorderable surrounds the context given, then this function will return null.
This method can be expensive (it walks the element tree).
This method does not create a dependency, and so will not cause rebuilding when the state changes.
See also:
- of, a similar function that will throw if no AnimatedReorderable ancestor is found.
Implementation
static AnimatedReorderableState? maybeOf(BuildContext context) {
return context.findAncestorStateOfType<AnimatedReorderableState>();
}