FallbackPrompt class
Line-mode prompt primitives for limited terminal environments.
These helpers only use TerminalContext.input.readLineSync,
TerminalContext.output.write, and TerminalContext.output.writeln. They
do not enter raw mode, hide the cursor, clear the screen, or emit ANSI
sequences.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
confirm(
{required String title, bool defaultValue = false}) → bool - Reads a yes/no answer.
-
form(
{required List< FallbackFormField> fields, String? crossValidator(List<String> values)?, bool returnDefaultOnEndOfInput = true}) → FallbackFormResult? - Reads a multi-field form in line mode.
-
multiSelect<
T> ({required String title, required List< T> options, Set<int> ? defaultIndices, int? fallbackIndex, FallbackLabelBuilder<T> ? labelBuilder, bool returnDefaultOnEndOfInput = true}) → List<T> - Reads one-based multi-selection input.
-
number(
{required String title, num? defaultValue, num? min, num? max, FallbackNumberValidator? validator, bool returnDefaultOnEndOfInput = true}) → num? - Reads a number.
-
password(
{required String title, bool required = true, FallbackTextValidator? validator, bool returnDefaultOnEndOfInput = true}) → String? - Reads a password using the same line-mode path as text.
-
range(
{required String title, String? startTitle, String? endTitle, num? startDefault, num? endDefault, num? min, num? max, FallbackNumberValidator? validator, bool returnDefaultOnEndOfInput = true}) → FallbackRangeResult? - Reads an ordered numeric range using the same validation path as number.
-
singleSelect<
T> ({required String title, required List< T> options, int? defaultIndex = 0, FallbackLabelBuilder<T> ? labelBuilder, bool returnDefaultOnEndOfInput = true}) → T? - Reads a one-based single selection.
-
text(
{required String title, String? defaultValue, bool required = false, FallbackTextValidator? validator, bool returnDefaultOnEndOfInput = true}) → String? - Reads a line of text.