mirror of
https://github.com/lucavenir/go_router_riverpod.git
synced 2025-08-06 14:59:53 +08:00
27 lines
1.4 KiB
Markdown
27 lines
1.4 KiB
Markdown
# Go Router + Riverpod Examples
|
|
|
|
This repo contains a plethora of examples on how to integrate [GoRouter] and [Riverpod] altogether.
|
|
These examples are community driven and strive to represent most of the solutions the community have found.
|
|
|
|
Every example in here is a simple mock of a login / logout logic. Feel free to create PR to introduce more examples.
|
|
|
|
|
|
**NOTE.** It is strongly encouraged to avoid the `legacy` examples.
|
|
|
|
## Special Thanks
|
|
**BIG THANKS** to @creativecreatorormaybenot for introducing a clever, yet simple way of handling GoRouter with Riverpod. Its contributions made possible to simplify (a lot!) the updated examples.
|
|
|
|
(legacy examples are still being showcased in a dedicated folder, as a migration steps for whoever)
|
|
|
|
## Which example should I read or use?
|
|
I do realize there are _a lot_ of examples right now. I've cleaned up the folders in here and I can tell you this:
|
|
|
|
1. Try the `sync_router` folder first: that's a basic integration example with synchronous redirect
|
|
2. Then, read the `complete_example` folder and try that out. There's a lot going on there: enjoy.
|
|
|
|
Please consider starring this mini-repo if you found it useful. If you didn't, or if you want to contribute in any way, a discussion about improving this example can be found [here].
|
|
|
|
[Riverpod]: https://github.com/rrousselGit/river_pod
|
|
[GoRouter]: https://github.com/flutter/packages/tree/main/packages/go_router
|
|
[here]: https://github.com/rrousselGit/riverpod/discussions/1357
|