completeFutureResult<R> function
Completes a completer with a message created by sendFutureResult
The response
must be a message on the format sent by sendFutureResult.
Implementation
void completeFutureResult<R>(List<Object?> response, Completer<R> completer) {
if (response.length == 2) {
var error = RemoteError(response[0] as String, response[1] as String);
completer.completeError(error, error.stackTrace);
} else {
var result = response[0] as R;
completer.complete(result);
}
}