runFunction method

Future runFunction(
  1. BuildContext context,
  2. SupabaseAction action,
  3. int loop
)

Implementation

Future<dynamic> runFunction(
    BuildContext context, SupabaseAction action, int loop) async {
  if (action is SelectSupabaseAction) {
    final request = getRequest(context.apisState, action);
    if (getIt.isRegistered<UseCaseRegistry>()) {
      if (_useCaseRegistry.doesUseCaseExist(request.id)) {
        final res =
            await _useCaseRegistry.callUseCase(request.id, request.toJson());
        if (context.mounted) {
          await _fold(
            context: context,
            res: res,
            loop: loop,
            action: action,
            request: request,
          );
        }
        return;
      }
    }
    return await execute(
      context,
      request,
      action,
      loop,
    );
  }
  return null;
}