Closed pryshrm closed 2 years ago
@pryshrm can you post a complete but minimal repro project that demonstrates this issue? The behavior you're asking for works in all of my testing (a lot). I suspect something else is causing the issue.
I found the issue. In the GoRouter configuration (posted above), I have specified the name as 'tab1AndNote1' (notice the casing). Although, when calling goNamed(), I am using the same name with the exact same case but that doesn't work. However, when I changed the name to all lower case, it worked. i.e. goNamed('tab1andnote1', ...) is working....even though, in the configuration, the name is tab1AndNote1.
I found this out after I set debugLogDiagnostics: true. It printed out the name for the route as tab1andnote1 (all lower case).
So, the question now is, is this expected?
Ah. Name lookup should be case insensitive. I'll take a look.
As of now, it is neither case sensitive nor case insensitive because, as of now, route name tab1AndNote1 is matched only with goNamed('tab1andnote1').
this should be fixed in v2.2.3. @pryshrm can you confirm?
Given the router configuration below,
This works:
GoRouter.of(context!).pushNamed(**'note1'**, params: {'noteid': id!.toString()},);
and This does not work :
GoRouter.of(context!).goNamed(**'tab1AndNote1'**, params: {'noteid': id!.toString()},);
Exception: unknown route name: tab1AndNote1
So, my question is can the name given to the uppermost path segment ( here, tab1AndNote1 ) ever be used as a name?
I have the following go router configuration: