dispose method
Public programmatic dispose/cleanup.
Implementation
@override
void dispose() {
if (_isDisposed) return;
_isDisposed = true;
if (mode == ExecutionMode.standalone) {
TermuiBinding.unregister(this);
}
onPromptEnded?.call(this);
// Unmount element tree so focus nodes and states can clean up
_rootElement?.unmount();
_rootElement = null;
final activeCompleter = _completer;
if (activeCompleter != null && !activeCompleter.isCompleted) {
activeCompleter.complete(null);
}
onNeedVisualUpdate = null;
}