listen abstract method
void
listen(
- void onResponse(
- Response response
- void onNotification(
- Notification notification
- void onError(
- dynamic error
- void onDone()?,
Listen to the channel for responses and notifications. If a response is
received, invoke the onResponse
function. If a notification is received,
invoke the onNotification
function. If an error is encountered while
trying to read from the socket, invoke the onError
function. If the
socket is closed by the plugin, invoke the onDone
function. Only one
listener is allowed per channel.
Implementation
void listen(void Function(Response response) onResponse,
void Function(Notification notification) onNotification,
{void Function(dynamic error)? onError, void Function()? onDone});