-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Router outlet use first module children route to render #464
Comments
I made a test with a RouteGuard (which I add in guards of the route import 'package:flutter_modular/flutter_modular.dart';
class RedirectGuard implements RouteGuard {
@override
Future<bool> canActivate(String url, ModularRoute route) async {
print(
'URL: `$url` ---- Fragment: `${route.fragment}` ---- '
'Path: `${route.path}` ----- RouterName: `${route.routerName}`'
'ModulePath: `${route.modulePath}` ----- Uri: `${route.uri}`',
);
// Return `true`/`false` to allow/disallow access
return Future.value(true);
}
@override
String? get guardedRoute => '/home';
} When my page redirects from
So, I don't see how I can get the current route |
@Jictyvoo You have to set initial route in the material / cupertino app class instance. But there is a problem, it does not solve the issue with guards, which described above. |
Yes, this seems to solve the problem at first, thanks! |
It doesn't solve the problem with multiple nested modules |
Hey guys!
I really like how Modular looks and works, congrats to you all that develop this awesome library.
But I have a question, and a request if possible, it has someway to define the
RouterOutlet
first child to render?I'm currently developing an app that uses a
BottomNavigationBar
and aRouterOutlet
as the Scaffold body (just like in the documentation), but when I enter in the Widget, my navigationBar appear, but the Scaffold body is empty. How I can fix that? (I already tried to add a guard, but I fall in a loop because I can't get the full path of the router (exemple below).'/' RouterOutlet
(it's another module)One way that I think is if in
ModularRoute
we can set an index with default children to be rendered by RouterOutletThe text was updated successfully, but these errors were encountered: