plex_router/plex_route_guard library
Classes
- PlexAuthGuard
-
Redirects to loginPath if
currentUseris null. - PlexRoleGuard
- Redirects (excludes route) if user lacks the required rule.
- PlexRouteContext
- Context passed to PlexRouteGuard when evaluating a route.
- PlexRouteGuard
- Guard that can redirect before navigation. Return null to allow, or a path to redirect.
Functions
-
evaluateRouteGuards(
List< PlexRouteGuard> guards, String? rule, PlexRouteContext context) → Future<bool> -
Evaluates guards for a route. If
guardsis empty andruleis set, uses PlexRoleGuard. Returns true if the route is allowed, false if any guard redirects.