dependency_manager library

Classes

Ansi
Helper class to assist in printing text to the console with a color.
AnsiColor
Helper class to assist in printing text to the console with a color.
ArgParser
A class for taking a list of raw command line arguments and parsing out options and flags from them.
ArgResults
The results of parsing a series of command line arguments using ArgParser.parse.
CollectionStyle
An enum of collection styles.
Command<T>
A single command.
CommandlineConverter
Splits a String into a list of command-line argument parts. e.g. "command -p param" -> "command", "-p", "param"
CommandRunner<T>
A class for invoking Commands based on raw command-line arguments.
Context
An instantiable class for manipulating paths. Unlike the top-level functions, this lets you explicitly select what platform the paths will use.
Find
Implementation for the _find function.
FindItem
Holds details of a file system entity returned by the find function.
FindProgress
InternalProgress
Base class for functions that return some type of Progres.
Option
A command-line option.
OptionType
What kinds of values an option accepts.
PathMap<V>
A map whose keys are paths, compared using p.equals and p.hash.
PathSet
A set containing paths, compared using p.equals and p.hash.
ScalarStyle
An enum of source scalar styles.
Style
An enum type describing a "flavor" of path.
TagDirective
A directive describing a custom tag handle.
VersionDirective
A directive indicating which version of YAML a document was written to.
Which
Returned from the which funtion to provide the details we discovered about appname.
WhichSearch
Search resutls from the which method.
YamlDocument
A YAML document, complete with metadata.
YamlList
A read-only List parsed from YAML.
YamlMap
A read-only Map parsed from YAML.
YamlNode
An interface for parsed nodes from a YAML source tree.
YamlScalar
A wrapped scalar value parsed from YAML.

Extensions

StringExtension on String

Constants

capturePrinterrKey → const String
This class is highly experimental - use at your own risk. It is designed to capture any output to print or printerr within the scope of the callback. Key to the overloading printerr function. Key to the overloading printerr function.

Properties

context Context
The system path context.
final
current String
Gets the path to the current working directory.
no setter
posix Context
A default context for manipulating POSIX paths.
final
separator String
Gets the path separator for the current platform. This is \ on Windows and / on other platforms (including the browser).
no setter
style Style
Returns the Style of the current context.
no setter
url Context
A default context for manipulating URLs.
final
windows Context
A default context for manipulating Windows paths.
final
yamlWarningCallback YamlWarningCallback
A callback for emitting a warning.
getter/setter pair

Functions

absolute(String part1, [String? part2, String? part3, String? part4, String? part5, String? part6, String? part7, String? part8, String? part9, String? part10, String? part11, String? part12, String? part13, String? part14, String? part15]) String
Returns a new path with the given path parts appended to current.
basename(String path) String
Gets the part of path after the last separator.
basenameWithoutExtension(String path) String
Gets the part of path after the last separator, and without any trailing file extension.
black(String text, {AnsiColor background = AnsiColor.white, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.
blue(String text, {AnsiColor background = AnsiColor.none, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.
canonicalize(String path) String
Canonicalizes path.
copy(String from, String to, {bool overwrite = false}) → void
copyTree(String from, String to, {bool overwrite = false, bool filter(String file) = _allowAll, bool includeHidden = false, bool recursive = true}) → void
createDir(String path, {required bool recursive}) String
cyan(String text, {AnsiColor background = AnsiColor.none, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.
delete(String path) → void
deleteDir(String path, {bool recursive = true}) → void
dirname(String path) String
Gets the part of path before the last separator.
equals(String path1, String path2) bool
Returns true if path1 points to the same location as path2, and false otherwise.
exists(String path, {bool followLinks = true}) bool
checks if the given path exists.
extension(String path, [int level = 1]) String
Gets the file extension of path: the portion of basename from the last . to the end (including the . itself).
find(String pattern, {bool caseSensitive = false, bool recursive = true, bool includeHidden = false, String workingDirectory = '.', List<FileSystemEntityType> types = const [Find.file]}) FindProgress
findCore(String pattern, {required ProgressCallback progress, bool caseSensitive = false, bool recursive = true, bool includeHidden = false, String workingDirectory = '.', List<FileSystemEntityType> types = const [Find.file]}) → void
Returns the list of files in the current and child directories that match the passed glob pattern.
fromUri(Object? uri) String
Returns the path represented by uri, which may be a String or a Uri.
green(String text, {AnsiColor background = AnsiColor.none, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.
grey(String text, {double level = 0.5, AnsiColor background = AnsiColor.none, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.
hash(String path) int
Returns a hash code for path such that, if equals returns true for two paths, their hash codes are the same.
isAbsolute(String path) bool
Returns true if path is an absolute path and false if it is a relative path.
isDirectory(String path) bool
true if the given path is a directory.
isRelative(String path) bool
Returns true if path is a relative path and false if it is absolute. On POSIX systems, absolute paths start with a / (forward slash). On Windows, an absolute path starts with \\, or a drive letter followed by :/ or :\.
isRootRelative(String path) bool
Returns true if path is a root-relative path and false if it's not.
isWithin(String parent, String child) bool
Returns true if child is a path beneath parent, and false otherwise.
join(String part1, [String? part2, String? part3, String? part4, String? part5, String? part6, String? part7, String? part8, String? part9, String? part10, String? part11, String? part12, String? part13, String? part14, String? part15, String? part16]) String
Joins the given path parts into a single path using the current platform's separator. Example:
joinAll(Iterable<String> parts) String
Joins the given path parts into a single path using the current platform's separator. Example:
loadYaml(String yaml, {Uri? sourceUrl, bool recover = false, ErrorListener? errorListener}) → dynamic
Loads a single document from a YAML string.
loadYamlDocument(String yaml, {Uri? sourceUrl, bool recover = false, ErrorListener? errorListener}) YamlDocument
Loads a single document from a YAML string as a YamlDocument.
loadYamlDocuments(String yaml, {Uri? sourceUrl}) List<YamlDocument>
Loads a stream of documents from a YAML string.
loadYamlNode(String yaml, {Uri? sourceUrl, bool recover = false, ErrorListener? errorListener}) YamlNode
Loads a single document from a YAML string as a YamlNode.
loadYamlStream(String yaml, {Uri? sourceUrl}) YamlList
Loads a stream of documents from a YAML string.
magenta(String text, {AnsiColor background = AnsiColor.none, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.
move(String from, String to, {bool overwrite = false}) → void
moveDir(String from, String to) Future<void>
normalize(String path) String
Normalizes path, simplifying it by handling .., and ., and removing redundant path separators whenever possible.
orange(String text, {AnsiColor background = AnsiColor.none, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.
prettyUri(Object? uri) String
Returns a terse, human-readable representation of uri.
printerr(String? line) → void
printerr provides the equivalent functionality to the standard Dart print function but instead writes the output to stderr rather than stdout.
read(String path) List<String>
red(String text, {AnsiColor background = AnsiColor.none, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.
relative(String path, {String? from}) String
Attempts to convert path to an equivalent relative path from the current directory.
replace(String path, Pattern existing, String replacement, {bool all = false}) int
rootPrefix(String path) String
Returns the root of path, if it's absolute, or the empty string if it's relative.
setExtension(String path, String extension) String
Returns path with the trailing extension set to extension.
split(String path) List<String>
Splits path into its components using the current platform's separator.
touch(String path, {bool create = false}) String
toUri(String path) Uri
Returns the URI that represents path.
truepath(String part1, [String? part2, String? part3, String? part4, String? part5, String? part6, String? part7]) String
which(String appname, {bool first = true, bool verbose = false, bool extensionSearch = true, void progress(WhichSearch)?}) Which
Searches the PATH for the location of the application give by appname.
white(String text, {AnsiColor background = AnsiColor.none, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.
withoutExtension(String path) String
Removes a trailing extension from the last part of path.
yellow(String text, {AnsiColor background = AnsiColor.none, bool bold = true}) String
Wraps the passed text with the ANSI escape sequence for the color red. Use this to control the color of text when printing to the console.

Typedefs

CancelableLineAction = bool Function(String line)
Typedef for cancellable LineActions.
CaptureZonePrintErr = void Function(String?)
callback used when overloadin printerr in a DCliZone.
LineAction = void Function(String line)
Typedef for LineActions
ProgressCallback = bool Function(FindItem item)
YamlWarningCallback = void Function(String message, [SourceSpan? span])
A callback for emitting a warning.

Exceptions / Errors

ArgParserException
An exception thrown by ArgParser.
PathException
An exception class that's thrown when a path operation is unable to be computed accurately.
UsageException
YamlException
An error thrown by the YAML processor.