My project uses a package structure using melos. I have a my_app
in apps/my_app
. Also I have a package game
in packages/game
.
MyApp
has an AppRouter
, which is responsible for the router configuration. The Game
library has its own AppRouter
. MyApp
‘s home screen uses a Banner
widget that belongs to the Game
package. When you click on it, you go to another route, which belongs to the Game
package:
onTap: () async {
await context.router.push(
MyGamesRoute(tillStart: tillStart),
);
},
But now it doesn’t work because the context.router
contains the MyApp
router. I need the Game
package router to start being used at this moment.