pub library

Classes

DartExecutableWithPackageConfig
The result of a getExecutableForCommand command resolution.

Enums

CommandResolutionIssue
Information on why no executable is returned.

Functions

ensurePubspecResolved(String dir, {bool isOffline = false, bool summaryOnly = true, bool onlyOutputWhenTerminal = true}) Future<void>
Makes sure that dir/pubspec.yaml is resolved such that pubspec.lock and .dart_tool/package_config.json are up-to-date and all packages are downloaded to the cache.
getExecutableForCommand(String descriptor, {bool allowSnapshot = true, String? root, String? pubCacheDir, List<String> additionalSources = const [], String? nativeAssets}) Future<DartExecutableWithPackageConfig>
Returns the dart program/snapshot to invoke for running descriptor resolved according to the package configuration of the package at root (defaulting to the current working directory). Using the pub-cache at pubCacheDir (defaulting to the default pub cache).
pubCommand({required bool isVerbose()}) → Command<int>
Returns a Command for pub functionality that can be used by an embedding CommandRunner.

Exceptions / Errors

CommandResolutionFailedException
Indicates that a command string did not resolve to an executable.
ResolutionFailedException