From 959fa46ff898e9bec742830b9f778f4883fcbf0a Mon Sep 17 00:00:00 2001 From: ValentinVignal Date: Sat, 8 Jul 2023 23:42:49 +0800 Subject: [PATCH 1/2] core: Fix some typos --- packages/go_router/lib/src/configuration.dart | 4 +++- packages/go_router/lib/src/information_provider.dart | 8 ++++---- packages/go_router/lib/src/match.dart | 2 +- packages/go_router/lib/src/router.dart | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/go_router/lib/src/configuration.dart b/packages/go_router/lib/src/configuration.dart index a0a9b93c4e2..a4a97594718 100644 --- a/packages/go_router/lib/src/configuration.dart +++ b/packages/go_router/lib/src/configuration.dart @@ -45,7 +45,9 @@ class RouteConfiguration { } } else { if (route.path.startsWith('/') || route.path.endsWith('/')) { - throw GoError('sub-route path may not start or end with /: $route'); + throw GoError( + 'sub-route path may not start or end with "/": $route', + ); } } subRouteIsTopLevel = false; diff --git a/packages/go_router/lib/src/information_provider.dart b/packages/go_router/lib/src/information_provider.dart index e63ddf439f6..31a9e694279 100644 --- a/packages/go_router/lib/src/information_provider.dart +++ b/packages/go_router/lib/src/information_provider.dart @@ -36,9 +36,9 @@ enum NavigatingType { } /// The data class to be stored in [RouteInformation.state] to be used by -/// [GoRouteInformationPrarser]. +/// [GoRouteInformationParser]. /// -/// This state class is used internally in go_router and will not be send to +/// This state class is used internally in go_router and will not be sent to /// the engine. class RouteInformationState { /// Creates an InternalRouteInformationState. @@ -54,8 +54,8 @@ class RouteInformationState { /// The extra object used when navigating with [GoRouter]. final Object? extra; - /// The completer that needs to be complete when the newly added route is - /// popped off the screen.. + /// The completer that needs to be completed when the newly added route is + /// popped off the screen. /// /// This is only null if [type] is [NavigatingType.go]. final Completer? completer; diff --git a/packages/go_router/lib/src/match.dart b/packages/go_router/lib/src/match.dart index e0e98982915..9fef0af95b4 100644 --- a/packages/go_router/lib/src/match.dart +++ b/packages/go_router/lib/src/match.dart @@ -77,7 +77,7 @@ class RouteMatch { /// for example: /// /// uri = '/family/f2/person/p2' - /// route = GoRoute('/family/:id) + /// route = GoRoute('/family/:id') /// /// matchedLocation = '/family/f2' final String matchedLocation; diff --git a/packages/go_router/lib/src/router.dart b/packages/go_router/lib/src/router.dart index 7c061df24ac..8cd3464ba1b 100644 --- a/packages/go_router/lib/src/router.dart +++ b/packages/go_router/lib/src/router.dart @@ -168,7 +168,7 @@ class GoRouter implements RouterConfig { 'top-level path must start with "/": $route'); } else { assert(!route.path.startsWith('/') && !route.path.endsWith('/'), - 'sub-route path may not start or end with /: $route'); + 'sub-route path may not start or end with "/": $route'); } subRouteIsTopLevel = false; } else if (route is ShellRouteBase) { @@ -258,7 +258,7 @@ class GoRouter implements RouterConfig { /// Whether the imperative API affects browser URL bar. /// - /// The Imperative APIs refer to [push], [pushReplacement], or [Replace]. + /// The Imperative APIs refer to [push], [pushReplacement], or [replace]. /// /// If this option is set to true. The URL bar reflects the top-most [GoRoute] /// regardless the [RouteBase]s underneath. @@ -320,7 +320,7 @@ class GoRouter implements RouterConfig { /// Restore the RouteMatchList void restore(RouteMatchList matchList) { - log.info('going to ${matchList.uri}'); + log.info('restoring ${matchList.uri}'); routeInformationProvider.restore( matchList.uri.toString(), encodedMatchList: RouteMatchListCodec(configuration).encode(matchList), From ce041b0f3e955b779aebe7ed57fb2386d242b083 Mon Sep 17 00:00:00 2001 From: ValentinVignal Date: Sat, 8 Jul 2023 23:53:25 +0800 Subject: [PATCH 2/2] docs: Update CHANGELOG --- packages/go_router/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md index c345b25e88a..247c6f953e1 100644 --- a/packages/go_router/CHANGELOG.md +++ b/packages/go_router/CHANGELOG.md @@ -1,3 +1,7 @@ +## NEXT + +- Cleans some typos in the documentation and asserts. + ## 9.0.3 - Adds helpers for go_router_builder for StatefulShellRoute support