Skip to content

Commit 4f8598a

Browse files
[go_router] Avoid unnecessary null checks (#3142)
* Avoid unnecessary null checks The public static analysis complained about these errors and deducted the final package score on pub.dev * Upgrade package version
1 parent f2f6c5e commit 4f8598a

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

packages/go_router/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 6.0.5
2+
3+
- Fixes [unnecessary_null_comparison](https://dart-lang.github.io/linter/lints/unnecessary_null_checks.html) lint warnings.
4+
15
## 6.0.4
26

37
- Fixes redirection info log.

packages/go_router/lib/src/builder.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,6 @@ class RouteBuilder {
305305
{Widget? childWidget}) {
306306
final RouteBase route = match.route;
307307

308-
if (route == null) {
309-
throw _RouteBuilderError('No route found for match: $match');
310-
}
311-
312308
if (route is GoRoute) {
313309
final GoRouterWidgetBuilder? builder = route.builder;
314310

packages/go_router/lib/src/configuration.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class RouteConfiguration {
8181
],
8282
);
8383
}
84-
} else if (route is ShellRoute && route.navigatorKey != null) {
84+
} else if (route is ShellRoute) {
8585
_debugCheckParentNavigatorKeys(
8686
route.routes,
8787
<GlobalKey<NavigatorState>>[...allowedKeys..add(route.navigatorKey)],

packages/go_router/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: go_router
22
description: A declarative router for Flutter based on Navigation 2 supporting
33
deep linking, data-driven routes and more
4-
version: 6.0.4
4+
version: 6.0.5
55
repository: https://github.com/flutter/packages/tree/main/packages/go_router
66
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22
77

0 commit comments

Comments
 (0)