location property

String get location

Retrieves the location (path) associated with the current build context.

Implementation

String get location =>
    switch ((delegate.currentConfiguration, router.routeInformationParser)) {
      // No configuration available, return root path
      (null, _) => "/",

      // Configuration exists and parser is compatible
      (RouteDecoder config, RouteInformationParser<RouteDecoder> parser) =>
        parser.restoreRouteInformation(config)?.uri.path ?? "/",

      // Configuration exists but parser is not compatible
      _ => "/",
    };