You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document why GoRouterState.path and GoRouterState.fullpath can be non #121086
P3Issues that are less important to the Flutter projectd: api docsIssues with https://api.flutter.dev/p: go_routerThe go_router packagepackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team
Hello @momrak. Taking a quick look through the code, doesn't look like path has to be nullable. Though this is a very brief look and is non-conclusive to say the least. Here's a place where path is definitely not null. GoRoute.path is non-nullable so makes sense that path in GoRouterState can be non-nullable too. Same could apply for fullpath.
As I mentioned, my searching is non-conclusive so take this with a grain of salt. Labelling this issue for further insights from the team
changed the title [-][GoRouter] Question: nullable fullpath and path vs non-nullable subloc and location[/-][+]Make `GoRouterState.path` and `GoRouterState.fullpath` non-nullable[/+]on Feb 20, 2023
@chunhtai shouldn't this be documented somewhere? Seeing these fields being nullable but not knowing when I need to guard against is not a good feeling when building an app...
I also still don't quite get what you mean by It can be null when the corresponding Route is a ShellRoute. I have never seen fullpath being null. Path is empty string when i try printing it from a ShellRoute pagebuilder, but fullpath still has content. And as a shellroute does not have an explicit location this comment does not really clear things up for me.
So my suggestions is to properly document the behavior on these fields.
changed the title [-]Make `GoRouterState.path` and `GoRouterState.fullpath` non-nullable[/-][+]Document why `GoRouterState.path` and `GoRouterState.fullpath` can be non[/+]on Feb 27, 2023
P3Issues that are less important to the Flutter projectd: api docsIssues with https://api.flutter.dev/p: go_routerThe go_router packagepackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team
Activity
exaby73 commentedon Feb 20, 2023
Hello @momrak. Taking a quick look through the code, doesn't look like
pathhas to be nullable. Though this is a very brief look and is non-conclusive to say the least. Here's a place wherepathis definitely not null.GoRoute.pathis non-nullable so makes sense thatpathinGoRouterStatecan be non-nullable too. Same could apply forfullpath.As I mentioned, my searching is non-conclusive so take this with a grain of salt. Labelling this issue for further insights from the team
https://github.com/flutter/packages/blob/a162a98cff4dd14bb4e21ed512b42558bb38d953/packages/go_router/lib/src/builder.dart#L260
[-][GoRouter] Question: nullable fullpath and path vs non-nullable subloc and location[/-][+]Make `GoRouterState.path` and `GoRouterState.fullpath` non-nullable[/+]chunhtai commentedon Feb 23, 2023
It can be null when the corresponding Route is a ShellRoute
momrak commentedon Feb 27, 2023
@chunhtai shouldn't this be documented somewhere? Seeing these fields being nullable but not knowing when I need to guard against is not a good feeling when building an app...
I also still don't quite get what you mean by
It can be null when the corresponding Route is a ShellRoute. I have never seen fullpath being null. Path is empty string when i try printing it from a ShellRoute pagebuilder, but fullpath still has content. And as a shellroute does not have an explicit location this comment does not really clear things up for me.So my suggestions is to properly document the behavior on these fields.
[-]Make `GoRouterState.path` and `GoRouterState.fullpath` non-nullable[/-][+]Document why `GoRouterState.path` and `GoRouterState.fullpath` can be non[/+]3 remaining items
[go_router] Document when GoRouterState.name and path are null
[go_router] Document when GoRouterState.name and path are null (flutt…