isFirstOf static method
- BuildContext context
Returns ModalRoute.isFirst 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.isFirst changes.
Implementation
static bool? isFirstOf(BuildContext context) => _of(context, _ModalRouteAspect.isFirst)?.isFirst;