This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
[Proposal] Change navigatorBuilder
signature to (BuildContext, Widget, GoRouterState)
#171
Labels
This would fix a couple of problems with the existing signature:
The
Widget?
misleads the reader into thinking child may be null, when it never will, and forces the writer to add a redundant!
operator.It's awkward to make decisions inside of
navigatorBuilder
without a reference to the router or state, because you can not access the goRouter instance when defining it.I can access the router if I define it as a package level variable, but not when it is inside of a class or method.
[Edit] Actually it will work as a class field, if declared as
late
, which is great. Still no go inside of method though, likeinitState
The text was updated successfully, but these errors were encountered: