withTerminationReason method

CallState withTerminationReason(
  1. CallTerminationReason? reason
)

Set the termination reason for the call state - only for done.

Implementation

CallState withTerminationReason(CallTerminationReason? reason) {
  if (this != done) {
    throw StateError('Termination reason can only be set for done state');
  }
  _terminationReasons[this] = reason;
  return this;
}