Formatting
This commit is contained in:
parent
ddb7c6f1ee
commit
bce554ea3d
2 changed files with 7 additions and 7 deletions
|
@ -97,7 +97,8 @@ abstract class _BrowserRouterImpl<T> extends Router<T>
|
|||
@override
|
||||
void listen() {
|
||||
if (_listening) {
|
||||
throw StateError('The router is already listening for page changes.');}
|
||||
throw StateError('The router is already listening for page changes.');
|
||||
}
|
||||
_listening = true;
|
||||
_listen();
|
||||
}
|
||||
|
@ -156,7 +157,8 @@ class _PushStateRouter<T> extends _BrowserRouterImpl<T> {
|
|||
if ($base?.href?.isNotEmpty != true) {
|
||||
throw StateError(
|
||||
'You must have a <base href="<base-url-here>"> element present in your document to run the push state router.');
|
||||
} _basePath = $base.href.replaceAll(_straySlashes, '');
|
||||
}
|
||||
_basePath = $base.href.replaceAll(_straySlashes, '');
|
||||
if (listen) this.listen();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
/// Represents an error in route configuration or navigation.
|
||||
abstract class RoutingException extends Exception {
|
||||
factory RoutingException(String message) =>
|
||||
_RoutingExceptionImpl(message);
|
||||
factory RoutingException(String message) => _RoutingExceptionImpl(message);
|
||||
|
||||
/// Occurs when trying to resolve the parent of a [Route] without a parent.
|
||||
factory RoutingException.orphan() => _RoutingExceptionImpl(
|
||||
"Tried to resolve path '..' on a route that has no parent.");
|
||||
|
||||
/// Occurs when the user attempts to navigate to a non-existent route.
|
||||
factory RoutingException.noSuchRoute(String path) =>
|
||||
_RoutingExceptionImpl(
|
||||
"Tried to navigate to non-existent route: '$path'.");
|
||||
factory RoutingException.noSuchRoute(String path) => _RoutingExceptionImpl(
|
||||
"Tried to navigate to non-existent route: '$path'.");
|
||||
}
|
||||
|
||||
class _RoutingExceptionImpl implements RoutingException {
|
||||
|
|
Loading…
Reference in a new issue