PromptRunner<T> class

A helper class to run an interactive terminal prompt inline. It encapsulates the event loop, rendering to an inline buffer, and lifecycle management.

Constructors

PromptRunner({required Terminal terminal, required Widget widget, int? height, bool completeOnEnter = true, bool onKeyEvent(KeyEvent event)?, T onComplete()?})
Creates a new PromptRunner.

Properties

completeOnEnter bool
Whether pressing Enter automatically completes/confirms the prompt.
final
hashCode int
The hash code for this object.
no setterinherited
height int?
The height constraint of the inline rendering block. If null, calculated dynamically.
final
onComplete → T Function()?
An optional completion callback returning the final value of type T.
final
onKeyEvent bool Function(KeyEvent event)?
An optional key event handler callback. Returns true if prompt is completed.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
terminal Terminal
The active terminal instance.
final
widget Widget
The root widget configuration to display.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run() Future<T?>
Starts the inline prompt loop and returns a Future containing the final result.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited