done method
Programmatically completes the current prompt, returning an optional result.
This signals the managing PromptRunner to stop its run loop, teardown
its resources, and resolve the Future returned by PromptRunner.run with result.
Subsequent calls to this method after the prompt has already completed are safe no-ops.
Implementation
void done([Object? result]) {
_onDone(result);
}