Setting up router
After that let's create the configuration needed for the router. First, create the "router.dart" file under src/router/ with the following code.
After this run, the command "pub run build_runner build" on the terminal of the project to generate the router source code. After running it you should see a "router.gr.dart" file next to it where the generated source code is written.
What the above code basically does is register a new route for "ProductsScreen" and make it the initial route.
Last updated