sendFutureResult function

void sendFutureResult(
  1. Future<Object?> future,
  2. SendPort resultPort
)

Send the result of a future, either value or error, as a message.

The result of future is sent on resultPort in a form expected by either receiveFutureResult, completeFutureResult, or by the port of singleResultFuture.

Implementation

void sendFutureResult(Future<Object?> future, SendPort resultPort) {
  future.then<void>((value) {
    resultPort.send(list1(value));
  }, onError: (error, stack) {
    resultPort.send(list2('$error', '$stack'));
  });
}