PromptMode enum cli

How prompts get their answers.

Picked by PromptMode.current, which looks at the terminal unless it is set by hand or with the CMDLINE_PROMPTS environment variable (rich, line or unattended).

Inheritance
Available extensions

Values

rich → const PromptMode

Live, redrawn widgets driven by single key presses. Needs a real keyboard and a screen that understands escape codes.

line → const PromptMode

One question per line, answered by typing and pressing Enter. Used when input is piped in, or the screen can't move the cursor.

unattended → const PromptMode

No questions at all: every prompt takes its default, and a prompt without one throws PromptCancelled. Used in CI.

Properties

hashCode → int
The hash code for this object.
no setterinherited
index → int
A numeric identifier for the enumerated value.
no setterinherited
label → String

Available on Enum, provided by the EnumExtensions extension

The value's name split into words, like Dark mode for darkMode.
no setter
name → String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
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 Properties

current ↔ PromptMode
The mode prompts use right now. Set it to force one; set null to go back to detecting it.
getter/setter pair
forced → PromptMode?
The mode set by hand, or null when it is detected.
no setter

Static Methods

detect() → PromptMode
Works out the mode from the environment and Terminal.current.

Constants

values → const List<PromptMode>
A constant List of the values in this enum, in order of their declaration.