settingsOf static method

RouteSettings? settingsOf(
  1. BuildContext context
)

Returns ModalRoute.settings 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.settings changes.

Implementation

static RouteSettings? settingsOf(BuildContext context) =>
    _of(context, _ModalRouteAspect.settings)?.settings;