csells / go_router

The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
https://gorouter.dev
442 stars 96 forks source link

Extra parameter is null. #83

Closed rvlajcev closed 2 years ago

rvlajcev commented 2 years ago

go_router: ^2.1.0

flutter clean
flutter pub get
onPressed: () => context.go("/route", extra: MyClass())

GoRoute(      
      path: "/route",
      pageBuilder: (context, state) {
        try {
          final data = state.extra as MyClass;
        } catch (e) {
          print(e);
        }
...

Thank you.

csells commented 2 years ago

fixed in v2.1.1. @rvlajcev can you confirm?

rvlajcev commented 2 years ago

Yes, I can confirm. It's working fine now. Cheers