Skip to content

Commit 188a846

Browse files
[go_router] Fix some typos in the comments and asserts (flutter#4412)
While I'm working on making the `RouteMatchList` a `RouteMatchTree`, I'm fixing some typos/inconsistency in the comments and the assert messages. This PR fixes some of them. *List which issues are fixed by this PR. You must list at least one issue.* No issue but linked to https://docs.google.com/document/d/1HCgLi7ialw2Eqv-f_2z9ogdOfcmepIIqCsRhF-DT9dM/ *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
1 parent e47a2b5 commit 188a846

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

packages/go_router/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## NEXT
2+
23
- Fixes a typo in docs for `StatefulShellRoute.indexedStack(...)`.
4+
- Cleans some typos in the documentation and asserts.
35

46
## 9.0.3
57

packages/go_router/lib/src/configuration.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ class RouteConfiguration {
4545
}
4646
} else {
4747
if (route.path.startsWith('/') || route.path.endsWith('/')) {
48-
throw GoError('sub-route path may not start or end with /: $route');
48+
throw GoError(
49+
'sub-route path may not start or end with "/": $route',
50+
);
4951
}
5052
}
5153
subRouteIsTopLevel = false;

packages/go_router/lib/src/information_provider.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ enum NavigatingType {
3636
}
3737

3838
/// The data class to be stored in [RouteInformation.state] to be used by
39-
/// [GoRouteInformationPrarser].
39+
/// [GoRouteInformationParser].
4040
///
41-
/// This state class is used internally in go_router and will not be send to
41+
/// This state class is used internally in go_router and will not be sent to
4242
/// the engine.
4343
class RouteInformationState<T> {
4444
/// Creates an InternalRouteInformationState.
@@ -54,8 +54,8 @@ class RouteInformationState<T> {
5454
/// The extra object used when navigating with [GoRouter].
5555
final Object? extra;
5656

57-
/// The completer that needs to be complete when the newly added route is
58-
/// popped off the screen..
57+
/// The completer that needs to be completed when the newly added route is
58+
/// popped off the screen.
5959
///
6060
/// This is only null if [type] is [NavigatingType.go].
6161
final Completer<T?>? completer;

packages/go_router/lib/src/match.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class RouteMatch {
7777
/// for example:
7878
///
7979
/// uri = '/family/f2/person/p2'
80-
/// route = GoRoute('/family/:id)
80+
/// route = GoRoute('/family/:id')
8181
///
8282
/// matchedLocation = '/family/f2'
8383
final String matchedLocation;

packages/go_router/lib/src/router.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ class GoRouter implements RouterConfig<RouteMatchList> {
168168
'top-level path must start with "/": $route');
169169
} else {
170170
assert(!route.path.startsWith('/') && !route.path.endsWith('/'),
171-
'sub-route path may not start or end with /: $route');
171+
'sub-route path may not start or end with "/": $route');
172172
}
173173
subRouteIsTopLevel = false;
174174
} else if (route is ShellRouteBase) {
@@ -258,7 +258,7 @@ class GoRouter implements RouterConfig<RouteMatchList> {
258258

259259
/// Whether the imperative API affects browser URL bar.
260260
///
261-
/// The Imperative APIs refer to [push], [pushReplacement], or [Replace].
261+
/// The Imperative APIs refer to [push], [pushReplacement], or [replace].
262262
///
263263
/// If this option is set to true. The URL bar reflects the top-most [GoRoute]
264264
/// regardless the [RouteBase]s underneath.
@@ -320,7 +320,7 @@ class GoRouter implements RouterConfig<RouteMatchList> {
320320

321321
/// Restore the RouteMatchList
322322
void restore(RouteMatchList matchList) {
323-
log.info('going to ${matchList.uri}');
323+
log.info('restoring ${matchList.uri}');
324324
routeInformationProvider.restore(
325325
matchList.uri.toString(),
326326
encodedMatchList: RouteMatchListCodec(configuration).encode(matchList),

0 commit comments

Comments
 (0)