Skip to content

[go_router] Fix some typos in the comments and asserts #4412

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/go_router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## NEXT

- Fixes a typo in docs for `StatefulShellRoute.indexedStack(...)`.
- Cleans some typos in the documentation and asserts.

## 9.0.3

Expand Down
4 changes: 3 additions & 1 deletion packages/go_router/lib/src/configuration.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions packages/go_router/lib/src/information_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
/// Creates an InternalRouteInformationState.
Expand All @@ -54,8 +54,8 @@ class RouteInformationState<T> {
/// 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<T?>? completer;
Expand Down
2 changes: 1 addition & 1 deletion packages/go_router/lib/src/match.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions packages/go_router/lib/src/router.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class GoRouter implements RouterConfig<RouteMatchList> {
'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) {
Expand Down Expand Up @@ -258,7 +258,7 @@ class GoRouter implements RouterConfig<RouteMatchList> {

/// 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.
Expand Down Expand Up @@ -320,7 +320,7 @@ class GoRouter implements RouterConfig<RouteMatchList> {

/// 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),
Expand Down