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
directoryExists(String path) bool
Returns true if directory exists or false if not
fileExists(String path) bool
Returns true if file exists or false if not
getCwd() String
Gets current directory
getenv(String name) String?
Returns environment variable with name or null if not exists
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
isBinary(Uint8List bytes) bool
Returns true if bytes is binary else false
isBinaryFile(String file) 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 file) 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
pathRename(String oldPath, String newPath) → void
Renames a file or a directory
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
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
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