misc library

Properties

isInDebugMode → bool
Returns true if dart was run with `--enable-asserts' flag else false
no setter
pathOfTempDir → String
Returns system temporary directory path
no setter
pathOfUserDir → String
Returns system temporary directory path
no setter

Functions

adjustPackageName(String name) → String
Converts illegal characters for dart package name to underscore (_)
adjustTextNewlines(String s) → String
Replace non-unix new lines in a string to unix newlines
decryptBytes(String base64Text, String keyText, String ivText) → Uint8List
decryptText(String base64Text, String keyText, String ivText) → String
directoryExists(String path) → bool
Returns true if directory exists or false if not
encryptBytes(Uint8List bytes, String keyText, String ivText) → String
encryptText(String plainText, String keyText, String ivText) → String
fileExists(String path) → bool
Returns true if file exists or false if not
findExePath(String exe, {String cwd = ''}) → String?
Windows only: find exe from PAT}H variable (current working directory first, if specified).
getCwd() → String
Gets current directory
getenv(String name) → String?
Returns environment variable with name or null if not exists
httpGetBodyAsync(String $urlString) → Future<String?>
identicalBinaries(Uint8List bytes1, Uint8List bytes2) → bool
Returns true if byte1 and bytes2 are identical, false if not
installBinaryToTempDir(Uint8List bytes, {String prefix = '', dynamic suffix = '', int trial = 0}) → String
Installs bytes to temp dir and returns the full path of that file
installZipToTempDir(Uint8List bytes, {String prefix = '', dynamic suffix = '', int trial = 0}) → String
Installs zip bytes to temp dir and returns the full path of that directory
isBinary(Uint8List bytes) → bool
Returns true if bytes is binary else false
isBinaryFile(String path) → bool
Returns true if file's content is binary else false
isText(Uint8List bytes) → bool
Returns false if bytes is binary else true
isTextFile(String path) → bool
Returns false if file's content is binary else true
joinCommandLine(List<String> command) → String
Makes a command line string from List of String (arg list).
lastChars(String s, int len) → String
Returns last n characters of a string
md5(Uint8List bytes) → String
Returns MD5 hash
pathBaseName(String path) → String
Returns directory part (without extension) of a path
pathDirectories(String path) → List<String>
Returns all directories under a path
pathDirectoryName(String path) → String
Returns directory part of a path
pathExpand(String path) → String
Expands path with environment variables
pathExtension(String path) → String
Returns extension of a path
pathFileName(String path) → String
Returns file name part of a path
pathFiles(String path, [bool? recursive]) → List<String>
Returns all files under a path
pathFullName(String path) → String
Returns full path of a path
pathJoin(List<String> parts) → String
Joins the given path parts into a single path
pathRelative(String path, {String? from}) → String
pathRename(String oldPath, String newPath) → void
Renames a file or a directory
popd() → void
popd
pushd(String path) → void
pushd
readFileBytes(String path) → Uint8List
Reads file content as bytes
readFileLines(String path) → List<String>
Reads file content as lines
readFileString(String path) → String
Reads file content as string
reformatUglyYaml(String yaml) → String
reformatUglyYamlFile(String yamlPath) → void
setCwd(String path) → void
Sets current directory
sha1(Uint8List bytes) → String
Returns SHA-1 hash
sha224(Uint8List bytes) → String
Returns SHA-224 hash
sha256(Uint8List bytes) → String
Returns SHA-256 hash
sha512(Uint8List bytes) → String
Returns SHA-512 hash
splitCommandLine(String command) → List<String>
Split a command line string into List of String (arg list).
textToLines(String s) → List<String>
Splits string with newlines to list of lines
timeBasedVersionString() → String
Returns local time based version string
untarToDirectory(dynamic pathOrBytes, String destDir) → void
unzipCheck(dynamic pathOrBytes, String destDir) → bool
unzipToDirectory(dynamic pathOrBytes, String destDir) → void
uuidForNamespace(String ns) → String
Generate a v5 (namespace-name-sha1-based) id
uuidRandom() → String
Generates a RNG version 4 UUID (a random UUID)
uuidTimeBased() → String
Generates a time-based version 1 UUID
writeFileBytes(String path, Uint8List data) → void
Writes bytes data to file
writeFileString(String path, String data) → void
Writes string data to file