1

Let's say I have a route defined as the following:

GoRoute(
  path: Screen.classDetail.path,
  builder: (context, state) => AdminClassScreen(
    classItem: state.extra as Class,
  ),
),

and I navigate to it using

router.push(Screen.classDetail.path, extra: extra);

When I hot reload on Web, the application goes into a bad state because the object I am passing in as extra is not preserved. Is there a way around this?

Michael Jajou
  • 312
  • 2
  • 13

1 Answers1

0

I am suffering the same issue for two days now. So far as i understand from my researches,for go_router package there is no page refresh support on object-passed pages via extra .

Edit: i tried 2 more routing packages(auto_router , beamer). For object passed pages , all of the packages failing on hot reload. But i solved my problem by passing String pathParameter instead of object. Which this string is the parsed string of an index number. Then after passing to the page , parsed this string to the int again. Then i reached my object from an object list via this index number.

Hope this helps someone.