maybeOf static method Null safety
- BuildContext context
The ink controller from the closest instance of this class that encloses the given context.
Typical usage is as follows:
MaterialInkController? inkController = Material.maybeOf(context);
This method can be expensive (it walks the element tree).
See also:
- Material.of, which is similar to this method, but asserts if no Material ancestor is found.
Implementation
static MaterialInkController? maybeOf(BuildContext context) {
return context.findAncestorRenderObjectOfType<_RenderInkFeatures>();
}