lucavenir / go_router_riverpod

An example on how to use Riverpod + GoRouter
469 stars 70 forks source link

Go router no longer provide location in GoRouterState after 9.0 #34

Closed at15 closed 1 year ago

at15 commented 1 year ago

I was using state.location in redirect and found compile error after upgrade go router.

From https://pub.dev/packages/go_router/changelog

BREAKING CHANGE:

I tried updating the code with GoRouterState.of(context).matchedLocation but end up getting There is no modal route above current context like https://github.com/flutter/flutter/issues/130213

at15 commented 1 year ago

Changed to state.uri.path seems works for redirect https://github.com/lucavenir/go_router_riverpod/blob/master/firebase_example/lib/router.dart#L40 which is mentioned in 10 migration doc https://docs.google.com/document/d/1vjupshmFJtfGSOppZxp7Tzkq7dotcLxCcpdluuNYe1o/edit?resourcekey=0-aS66t4OcDTjJW50s-veSzQ ...

lucavenir commented 1 year ago

Hi there, and thank you for filing this. I'm fixing this ASAP.

lucavenir commented 1 year ago

Fixed