Member-only story

An Alternative To Flutter Navigator Anti-Patterns, Go Router Builder

Fred Grott
4 min readFeb 18, 2023

--

One of the underlying strategies out of DevOPS that we use in coding is moving something from run-time error to compile time error(or if we cannot do that then move to a debug tool, as in our data binding use of Provider or Riverpod). Path strings for navigator 2.0 paths will not generate compile time errors when the path strings are wrong. Instead, we need to transform that path to something of a typed nature to put into a compiled time error.

Let me show you how to do that with the Go Router Builder.

What I Am Using

I am using these packages for this example:

Go Router

Riverpod

And we need the annotation as well:

--

--

Fred Grott
Fred Grott

No responses yet