withReason method
Set the reason for the call state - only valid for reconnecting and dropped states.
Implementation
CallState withReason(NetworkReason reason) {
if (this != reconnecting && this != dropped) {
throw StateError(
'Reason can only be set for reconnecting or dropped states',);
}
_reasons[this] = reason;
return this;
}