onClose method
void
onClose()
Implementation
void onClose() {
// workaround for https://github.com/dart-lang/sdk/issues/27414
if (subscription != null) {
subscription!.cancel();
subscription = null;
}
}