maybeOf static method

DebugOverlayState? maybeOf(
  1. BuildContext? context
)

Finds the DebugOverlayState from the closest instance of this class that encloses the given context.

If no instance of this class encloses the given context, will return null. To throw an exception instead, use of instead of this function.

Implementation

static DebugOverlayState? maybeOf(BuildContext? context) {
  return context?.findAncestorStateOfType<DebugOverlayState>();
}