onError method Null safety

  1. @protected
void onError(
  1. dynamic error
)

OnError listener callback

Implementation

@protected
void onError(dynamic error) {
  _disconnect();
  if (onDisconnected != null) {
    MqttLogger.log(
        'MqttConnectionBase::_onError - calling disconnected callback');
    onDisconnected!();
  }
}