canActivate method

  1. @override
Future<bool> canActivate(
  1. String path,
  2. ModularRoute route
)

Returns a FutureOr

Implementation

@override
Future<bool> canActivate(String path, ModularRoute route) {
  final modulePath = releaseGuardedRoute ?? path.replaceAll('/', '');
  final isGrant = remoteConfig.getBool(modulePath);
  if (isGrant) {
    Groveman.debug('ReleaseGuard grant acess;');
    return Future.value(true);
  } else {
    Groveman.debug('ReleaseGuard block acess;');
    return Future.value(false);
  }
}