Created
December 15, 2020 16:31
-
-
Save jacobaraujo7/464ed71287793adc923814cebe80ab2d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyGuard extends RouteGuard { | |
| @override | |
| Future<bool> canActivate(String path, ModularRoute router) async { | |
| if (path == '/admin') { | |
| return await UserService().isAdmin(); | |
| } else { | |
| return true; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment