check static method

Future<String?> check(
  1. Object? context,
  2. Object? state,
  3. String policy
)

The route to redirect to, or null to let the page render.

Implementation

static Future<String?> check(
  Object? context,
  Object? state,
  String policy,
) async {
  final Future<bool> Function(String, String)? answer = decide;
  if (answer == null) return dvUnauthorizedRoute;
  final String location = _locationOf(state);
  return await answer(policy, location) ? null : dvUnauthorizedRoute;
}