[go_router_builder] Typed route with an int parameter generates a warning #164621
Labels
p: go_router_builder
The go_router_builder package
P2
Important issues not at the top of the work list
package
flutter/packages repository. See also p: labels.
team-go_router
Owned by Go Router team
triaged-go_router
Triaged by Go Router team
Steps to reproduce
This also happens in 2.8.2:
Expected results
Generated code does not show a warning in dart analyzer.
Code emitted should be int.parse(state.pathParameters['id']!) because the parameter is not nullable.
Actual results
Generated code is "int.parse()!", but parse() can never be null.
So dart correctly generates this warning:
The '!' will have no effect because the receiver can't be null.
Try removing the '!' operator.
Code sample
Code sample
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: