utils
library
Functions
-
assertNoPositionalArgsNorArgsAfterSeparator(ArgResults argResults, void usageException(String msg), {String? commandName, bool allowRest = false})
→ void
-
-
cachedPubspec({String? path})
→ Pubspec
-
-
ensureProcessExit(Process process, {bool forwardExitSignals = false, Logger? log})
→ void
-
Ensures that the current process does not exit until the given
process
exits.
-
flagValue(ArgResults? argResults, String name)
→ bool?
-
-
globalPackageIsActiveAndCompatible(String packageName, VersionConstraint constraint, {Map<String, String>? environment})
→ bool
-
Returns
true
if packageName
is globally activated at a version
allowed by constraint
. Returns false
otherwise.
-
humanReadable(Duration duration)
→ String
-
Returns a human readable string for a duration.
-
-
logTimedAsync<T>(Logger logger, String description, Future<T> action(), {Level level = Level.INFO})
→ Future<T>
-
Logs an asynchronous
action
with description
before and after.
-
logTimedSync<T>(Logger logger, String description, T action(), {Level level = Level.INFO})
→ T
-
Logs a synchronous
action
with description
before and after.
-
multiOptionValue(ArgResults? argResults, String name)
→ Iterable<String>?
-
-
organizeDirectives(String sourceFileContents)
→ String
-
Takes in a file as a string and organizes the imports and exports.
Sorts imports/exports and removes double quotes.
-
packageIsImmediateDependency(String packageName, {String? path})
→ bool
-
Returns
true
if packageName
is an immediate dependency, and false
otherwise.
-
runProcessAndEnsureExit(ProcessDeclaration processDeclaration, {Logger? log})
→ Future<int>
-
-
singleOptionValue(ArgResults? argResults, String name)
→ String?
-
-
splitSingleOptionValue(ArgResults? argResults, String name)
→ Iterable<String>?
-