call<T> method

Future<HttpsCallableResult<T>> call<T>(
  1. [dynamic parameters]
)

Executes this Callable HTTPS trigger asynchronously.

The data passed into the trigger can be any of the following types:

null String num List, where the contained objects are also one of these types. Map, where the values are also one of these types.

The request to the Cloud Functions backend made by this method automatically includes a Firebase Instance ID token to identify the app instance. If a user is logged in with Firebase Auth, an auth ID token for the user is also automatically included.

Implementation

Future<HttpsCallableResult<T>> call<T>([dynamic parameters]) async {
  assert(_debugIsValidParameterType(parameters));

  Object? updatedParameters;
  if (parameters is Map) {
    Map update = {};
    parameters.forEach((key, value) {
      update[key] = _updateRawDataToList(value);
    });
    updatedParameters = update;
  } else if (parameters is List) {
    List update = parameters.map(_updateRawDataToList).toList();
    updatedParameters = update;
  } else {
    updatedParameters = _updateRawDataToList(parameters);
  }
  return HttpsCallableResult<T>._(await delegate.call(updatedParameters));
}