io library

Classes

IndentedStringBuffer
IsolatedStdIn
SharedStdIn
A singleton wrapper around stdin that allows new subscribers.

Constants

errorColor → const AnsiColorizer
execute → const FileStatPermission
infoColor → const AnsiColorizer
read → const FileStatPermission
warningColor → const AnsiColorizer
write → const FileStatPermission

Properties

isolatedStdin IsolatedStdIn
The standard input stream of data read by this program, but executed in an Isolate other than the calling one.
final
sharedStdIn SharedStdIn
A shared singleton instance of dart:io's stdin stream.
final

Functions

checkDirectoryExists(String path, [String? name]) Directory
Check if the Directory at path exists, if not throw an ArgumentError.
checkFileExists(String path, [String? name]) File
Check if the File at path exists, if not throw an ArgumentError.
checkLeadsToFiletype(String path, FileSystemEntityType type) → void
Check that path leads to a FileSystemEntity of type.
copyDirectory(String path, Directory target) Future<Directory?>
Copy the directory at path recursively into target.
copyDirectorySync(String path, Directory target) Directory?
Copy the directory at path recursively into target.
copyFile(String path, Directory target) Future<File?>
Copy the file at path into target.
copyFileSync(String path, Directory target) File?
Copy the file at path into target.
defaultAnswerReader() Future<String?>
The default value for answerReader for promptYesNo, promptUntilValidPick and pause.
deleteSync(String path) → void
existsSync(String path) bool
Returns true if any file or directory exists at path.
pause({StringSink? output, PromptAnswerReader answerReader = defaultAnswerReader}) Future<void>
Notice
pauseSync({StringSink? output}) → void
Notice
printErr(Object? object, [String end = "\n"]) → void
Prints a string representation of object to stderr.
printError(Object? object, [String end = "\n"]) → void
printInfo(Object? object, [String end = "\n"]) → void
printOut(Object? object, [String end = "\n"]) → void
Prints a string representation of object to stdout.
printProgessAnimation<T>(FutureOrResultCallback<T> workload, {Duration? animationSpeed, ProgressAnimationType type = ProgressAnimationType.spinningBar, StringSink? output}) Future<T>
Write a progess animation to output while waiting for workload.
printWarning(Object? object, [String end = "\n"]) → void
promptUntilValidPick<T extends Object>({required String prompt, required Set<T> options, required StringifiedPromptOption stringify(int index, T option), PromptAnswerReader answerReader = defaultAnswerReader, String onError(String input)?, String selectorFormatter(String selector)?, T? defaultValue, String separator = ")", String promptIndent = "", String optionsIndent = "\t", String errorIndent = "", StringSink? output}) Future<T>
Notice
promptUntilValidPickSync<T extends Object>({required String prompt, required Set<T> options, required StringifiedPromptOption stringify(int index, T option), String onError(String input)?, String selectorFormatter(String selector)?, T? defaultValue, String separator = ")", String promptIndent = "", String optionsIndent = "\t", String errorIndent = "", StringSink? output}) → T
Notice
promptYesNo(String question, {bool defaultToYes = true, StringSink? output, PromptAnswerReader answerReader = defaultAnswerReader}) Future<bool>
Notice
promptYesNoSync(String question, {bool defaultToYes = true, StringSink? output}) bool
Notice
setColorPrintersOptions({bool? enable, StringSink? outSink, StringSink? errSink}) → void
Sets the options for printInfo, printWarning and printError.
tryProcessRunSync(String executable, List<String> args, {String? workingDirectory, Map<String, String>? environment, bool includeParentEnvironment = true, bool runInShell = false, Encoding? stdoutEncoding = systemEncoding, Encoding? stderrEncoding = systemEncoding, void onProcessException(ProcessException exception, StackTrace stackTrace)?}) ProcessResult?
Tries to synchronously run the executable with the provided args.

Typedefs

PromptAnswerReader = FutureOr<String?> Function()
A function that reads the users' answer to a prompt.
StringifiedPromptOption = ({String option, String selector})