GoRouterModularContextExtension extension

Convenience extensions on BuildContext for the GenAI Components modular router.

These helpers query RouteRegistry (the internal name → path map populated by Module.configureRoutes) so callers can navigate by name without having to know the absolute path of a route.

on

Methods

goIfDefined(String pathOrName, {Object? extra}) → void

Available on BuildContext, provided by the GoRouterModularContextExtension extension

Navigates to pathOrName only if isRouteDefined returns true.
isRouteDefined(String pathOrName) bool

Available on BuildContext, provided by the GoRouterModularContextExtension extension

Returns true when pathOrName matches a route currently registered in RouteRegistry.