maybeOf static method

MaterialInkController? maybeOf(
  1. BuildContext context
)

The ink controller from the closest instance of this class that encloses the given context within the closest LookupBoundary.

Typical usage is as follows:

MaterialInkController? inkController = Material.maybeOf(context);

This method can be expensive (it walks the element tree).

See also:

Implementation

static MaterialInkController? maybeOf(BuildContext context) {
  return LookupBoundary.findAncestorRenderObjectOfType<_RenderInkFeatures>(context);
}