pushEvent method
Push a message with a valid PhoenixChannelEvent name.
This variant is used internally for channel joining/leaving. Prefer using push instead.
Implementation
Push pushEvent(
PhoenixChannelEvent event,
Map<String, dynamic> payload, [
Duration? newTimeout,
]) {
assert(_joinedOnce);
final pushEvent = Push(
this,
event: event,
payload: () => payload,
timeout: newTimeout ?? _timeout,
);
if (canPush) {
pushEvent.send();
} else {
if (_state == PhoenixChannelState.closed) {
throw ChannelClosedError('Can\'t push event on a closed channel');
}
pushBuffer.add(pushEvent);
}
return pushEvent;
}