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
441 stars 96 forks source link

add onCreate / onDispose methods #307

Closed subzero911 closed 2 years ago

subzero911 commented 2 years ago

Continuing this topic https://github.com/csells/go_router/issues/297

i have added experimental onCreate / onDispose callbacks to GoRoute my idea is that I can register / unregister dependencies in these callbacks with custom IoC (GetIt / Kiwi or other)

haven't tested it yet

subzero911 commented 2 years ago

I checked it with provided example not working... onCreate() fires on app start because GoRoutes already present in the page stack, and constructor works immediately. But I need to call it on actual page push only.

csells commented 2 years ago

@subzero911 am I reading the comments correctly? are these changes not working in the tests?

subzero911 commented 2 years ago

Yes, these changes are not working. I couldn't understand your code and did something wrong. But you got my idea.

csells commented 2 years ago

can you create or reopen the feature request?

subzero911 commented 2 years ago

@csells I already opened the topic before, but you closed it. https://github.com/csells/go_router/issues/297#issuecomment-1008436177

csells commented 2 years ago

Thanks. Reopened https://github.com/csells/go_router/issues/297.