I Prefer using constants on the page itself to use for navigation. I personally use the PageName.Route and use it everywhere. Each page knows what the name of itself is. Thanks for the video :) It has been helpful. I loved the part where you keep the go_router inside its own file and keep things clean in the main screen.
Are the constants then replacing the enum? so you'd have for example const game = "game" then use game for the name & "/$game" for the path? Seems like a good way to do it
@@1ManStartup Whether you use it or not, I prefer this way because the page itself should know what its own name is. If I have to change the name, I know where to go instead of hunting a gigantic constants file (this can be solved though through simple refactoring)... It is just my way of coding. There may be other good ways though.
the store path and the name in the screen file can conflict. for example you have 30 screens in your application. for example you have a forgot password screen and a password change screen. on the forgot password screen you can use name = "resetPassword" while on the password change screen someone else can use name = "resetPassoword". enum doesn't make you visit a page, but you can use advanced enum usage with parameters. not just a name. use enums in constructive ways... ( funny part in this message, I am also keep the path and name value in the page :) but I'm not happy with it. as I said you can accidentally use the same path or name value on another page. it can be overlooked... I recommend advanced enum usage )
I Prefer using constants on the page itself to use for navigation. I personally use the PageName.Route and use it everywhere. Each page knows what the name of itself is. Thanks for the video :) It has been helpful. I loved the part where you keep the go_router inside its own file and keep things clean in the main screen.
Are the constants then replacing the enum? so you'd have for example
const game = "game"
then use game for the name & "/$game" for the path?
Seems like a good way to do it
@@1ManStartup No, they are not enum. They are strings and I call it like Navigator.of(context).pushNamed(PageToNavigate.Route);
@@PankajNikam oh got it so then you're not using go router at all?
@@1ManStartup Whether you use it or not, I prefer this way because the page itself should know what its own name is. If I have to change the name, I know where to go instead of hunting a gigantic constants file (this can be solved though through simple refactoring)... It is just my way of coding. There may be other good ways though.
the store path and the name in the screen file can conflict. for example you have 30 screens in your application. for example you have a forgot password screen and a password change screen.
on the forgot password screen you can use name = "resetPassword" while on the password change screen someone else can use name = "resetPassoword". enum doesn't make you visit a page, but you can use advanced enum usage with parameters. not just a name. use enums in constructive ways... ( funny part in this message, I am also keep the path and name value in the page :) but I'm not happy with it. as I said you can accidentally use the same path or name value on another page. it can be overlooked... I recommend advanced enum usage )
Great video! Concise, and to the point!. Thank you!
Glad you enjoyed it!
What extensions do you use for suggestions (which show the expected)?
Not sure exactly what you mean but this video shows my whole VSCode setup czcams.com/video/rSI3-zxJZVc/video.html