setListener static method
Set listener
- parameter
listener
is optional. When the parameter is null or omitted,
Implementation
// the previous set listener will be removed. The only one listener
// may be used at the same time, so the new listener replaces the previous.
static Future<void> setListener({ApphudListener? listener}) async {
_apphudListenerHandler?.dispose();
_apphudListenerHandler = null;
if (listener != null) {
_apphudListenerHandler = ApphudListenerHandler(
channel: _listenerChannel,
listener: listener,
);
}
}