onClose method

void onClose()

Implementation

void onClose() async {
  if (client != null) {
    await client!.close(force: true);
  }
}