dispose method
This method should be called during dispose method in Flutter widget or any another cases that require to cancel all subscriptions and all methods
This method will started with disconnect call
In Flutter you can add such methods in dispose override.
@override
void dispose() {
client?.dispose();
host?.dispose();
super.dispose();
}
Implementation
@override
void dispose() {
disconnect();
h.eventStreamController.close();
}