lucavenir / go_router_riverpod

An example on how to use Riverpod + GoRouter
460 stars 68 forks source link

Changed the main example with code gen tools #8

Closed lucavenir closed 1 year ago

lucavenir commented 1 year ago

Addresses several issues pointed out from the community onto complete_example, such as:

  1. Unnecessary starting rebuilds
  2. Scalability issues (e.g. "how do I add more listeners?")
  3. Exploits code generation extensively
  4. Allows for more stable APIs (touching this example will feel less risky
  5. Uses a ProviderObserver, which allows for better understanding of the example

Yes, the code is still (loosely) tested.

You'll notice big changes with respect the old example. Furthermore, the new Notifier API is exploited, so at a first glance it seems like I've made a step backwards, but it's actually the other way around.

As soon as you'll try this, you'll feel more "in control" of what's going on. Just try this out and let me know what you think.

Potentially solves #7 and resolves what #5 was trying to solve.