isActiveOf static method

bool? isActiveOf(
  1. BuildContext context
)

Returns ModalRoute.isActive for the modal route most closely associated with the given context.

Returns null if the given context is not associated with a modal route.

Calling this method creates a dependency on the ModalRoute associated with the given context. As a result, the widget corresponding to context will be rebuilt whenever the route's ModalRoute.isActive changes.

Implementation

static bool? isActiveOf(BuildContext context) =>
    _of(context, _ModalRouteAspect.isActive)?.isActive;