connectionChanged method

void connectionChanged(
  1. bool status
)

Implementation

void connectionChanged(bool status) {
  if (status) {
    _connected = true;
    if (_afterConnectionFunc != null) {
      _afterConnectionFunc!(_connected!);
    }
    update();
  } else {
    _connected = false;
    if (_afterConnectionFunc != null) {
      _afterConnectionFunc!(_connected!);
    }
    update();
  }
}