diff --git a/lib/browser.dart b/lib/browser.dart index 5659b9aa..81969d66 100644 --- a/lib/browser.dart +++ b/lib/browser.dart @@ -97,7 +97,8 @@ abstract class _BrowserRouterImpl extends Router @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 extends _BrowserRouterImpl { if ($base?.href?.isNotEmpty != true) { throw StateError( 'You must have a 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(); } diff --git a/lib/src/routing_exception.dart b/lib/src/routing_exception.dart index aa63f1a9..bceb6cb5 100644 --- a/lib/src/routing_exception.dart +++ b/lib/src/routing_exception.dart @@ -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 {