prompts
library
Functions
-
choose<T>(String message, Iterable<T> options, {T? defaultsTo, String prompt = 'Enter your choice', bool chevron = true, bool colon = true, AnsiCode inputColor = cyan, bool color = true, bool conceal = false, bool interactive = true, Iterable<String>? names})
→ T?
-
Displays to the user a list of
options
, and returns
once one has been chosen.
-
chooseShorthand<T>(String message, Iterable<T> options, {T? defaultsTo, bool chevron = true, bool colon = true, AnsiCode inputColor = cyan, bool color = true, bool conceal = false})
→ T?
-
Similar to choose, but opts for a shorthand syntax that fits into one line,
rather than a multi-line prompt.
-
clearLine()
→ void
-
Clears the current line, and goes back to the start of the line.
-
get(String message, {bool validate(String)?, String? defaultsTo, bool colon = true, bool chevron = true, bool color = true, bool allowMultiline = false, bool conceal = false, AnsiCode inputColor = cyan})
→ String
-
Prompt the user, and return the first line read.
This is the core of
Prompter
, and the basis for all other
functions.
-
getBool(String message, {bool defaultsTo = false, bool appendYesNo = true, bool color = true, bool chevron = true, bool conceal = false, bool colon = true, AnsiCode inputColor = cyan})
→ bool
-
Presents a yes/no prompt to the user.
-
getDouble(String message, {double? defaultsTo, bool color = true, bool chevron = true, bool colon = true, bool conceal = false, AnsiCode inputColor = cyan})
→ double
-
Prompts the user to enter a double.
-
getInt(String message, {int? defaultsTo, int radix = 10, bool color = true, bool chevron = true, bool conceal = false, bool colon = true, AnsiCode inputColor = cyan})
→ int
-
Prompts the user to enter an integer.
-
goUpOneLine()
→ void
-
Goes up one line.