HasCoursesGuard class

Guard that checks if the user has any courses enabled. Redirects to the course selection screen per default if no courses are enabled.

Inheritance
  • Object
  • Middleware<ModularArguments>
  • HasCoursesGuard
Implemented types

Constructors

HasCoursesGuard({String? redirectTo = '/moodle/select-courses/'})
Guard that checks if the user has any courses enabled. Redirects to the course selection screen per default if no courses are enabled.

Properties

hashCode int
The hash code for this object.
no setterinherited
redirectTo String?
If the route is not allowed then the Guard will redirect to that route.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canActivate(String path, ModularRoute route) Future<bool>
Returns a FutureOr. If true, allow the route to continue processing. If it is false, the Guard will try to redirect the route. If there is no redirect then an error will be thrown GuardedRouteException.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pos(ModularRoute route, ModularArguments data) FutureOr<ParallelRoute?>
Method called as soon as route is found and after settings.
inherited
pre(ModularRoute route) FutureOr<ModularRoute?>
Method called as soon as route is found and before settings.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited