dispose method
If you don't need a command any longer it is a good practise to dispose it to make sure all registered notification handlers are remove to prevent memory leaks
Implementation
@override
void dispose() {
_commandResult.dispose();
_canExecute.dispose();
_isExecuting.dispose();
_thrownExceptions.dispose();
if (!(_futureCompleter?.isCompleted ?? true)) {
_futureCompleter!.complete(null);
}
super.dispose();
}