io
library
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
.