dispose method
Implementation
Future<void> dispose() async {
if (_onDispose != null) {
_cmdController.add(_onDispose!(_model));
await Future.delayed(Duration.zero);
}
await _msgSubscription.cancel();
await _cmdSubscription.cancel();
for (final subscription in _externalSubscriptions) {
await subscription.cancel();
}
await _cmdController.close();
await _msgController.close();
await _modelController.close();
}