withNetworkReason method

CallState withNetworkReason(
  1. NetworkReason reason
)

Set the network reason for the call state - only for reconnecting or dropped.

Implementation

CallState withNetworkReason(NetworkReason reason) {
  if (this != reconnecting && this != dropped) {
    throw StateError(
      'Reason can only be set for reconnecting or dropped states',
    );
  }
  _networkReasons[this] = reason;
  return this;
}