Closed talamaska closed 4 years ago
I also want to know the same thing because I use dynamic route from list
Hey, its up to you if you want to use a static method or not. Just make sure to use the same Sailor
instance throughout the application, because if you create a new Sailor
instance from within the app, it will not have all the routes registered to it.
IMO, keep the Routes
class static, or use singleton pattern, or any other method that makes sure that you will be using the same Sailor
instance.
Is it possible to actually have the createRoutes function not as static method? If I do this, I just have to change in my main.dart to call Router().createRoutes(); instead of Router.createRoutes(), and it seems it's still working fine. Not sure i understand the implications.