onClose method
void
onClose()
Invoked when the instance is removed from the scope or the scope is disposed.
Use this method to cancel timers, close streams, or release other system resources.
Implementation
void onClose() {}