class SearchModule extends ModuleWidget {
@override
List<Bind> get binds => [
Bind((i) => SearchController()),
];
@override
List<Router> get routers => [
Router(Modular.initialRoute, child: (_, args) => SearchPage()),
Router("teacher", child: (_, args) => TeacherListPage()),
];
@override
Widget get view => SearchPage();
static Inject get to => Inject<SearchModule>.of();
}
I can't access the "teacher" route for this module. That is, I cannot navigate to this route using the method Modular.to.pushNamed('/teacher', arguments: TeacherListPage())
I get the following error .: Could not find a generator for route RouteSettings("/teacher", TeacherListPage) in the _WidgetsAppState.
Can anyone give me a light?? kkk
Follow the flow of the modules.:
I/flutter (13793): -- AppModule INITIALIZED
I/flutter (13793): -- HomeModule INITIALIZED
I/flutter (13793): -- ReviewsModule INITIALIZED
I/flutter (13793): -- HomeModule DISPOSED
I/flutter (13793): -- SearchModule INITIALIZED
Follows the structure of the modules .:
<------------------------------------------------------------------------>
class AppModule extends MainModule {
@override
List<Bind> get binds => [
Bind((i) => TeacherListController()),
Bind((i) => ReviewsContentController()),
Bind((i) => SigninController()),
Bind((i) => SignupController()),
Bind((i) => AppController()),
];
@override
List<Router> get routers => [
Router(Modular.initialRoute, module: HomeModule()),
Router('/reviews', module: ReviewsModule()),
];
@override
Widget get bootstrap => AppWidget();
static Inject get to => Inject<AppModule>.of();
}
<------------------------------------------------------------------------>
class HomeModule extends ChildModule {
@override
List<Bind> get binds => [
Bind((i) => HomeController()),
];
@override
List<Router> get routers => [
Router(Modular.initialRoute, child: (_, args) => HomePage()),
Router("signUp", child: (_, args) => SignupPage()),
Router("signIn", child: (_, args) => SigninPage()),
];
static Inject get to => Inject<HomeModule>.of();
}
<------------------------------------------------------------------------>
class ReviewsModule extends ChildModule {
@override
List<Bind> get binds => [
Bind((i) => ReviewsController()),
];
@override
List<Router> get routers => [
Router(Modular.initialRoute, child: (_, args) => ReviewsPage()),
];
static Inject get to => Inject<ReviewsModule>.of();
}
<------------------------------------------------------------------------>
class SearchModule extends ModuleWidget {
@override
List<Bind> get binds => [
Bind((i) => SearchController()),
];
@override
List<Router> get routers => [
Router(Modular.initialRoute, child: (_, args) => SearchPage()),
Router("teacher", child: (_, args) => TeacherListPage()),
];
@override
Widget get view => SearchPage();
static Inject get to => Inject<SearchModule>.of();
}
<------------------------------------------------------------------------>