DartToolPaths class
Where dart pub global activate and dart install put their files,
computed from an environment map so that every platform can be tested.
Rules (verified against the sources on 2026-09-28):
- pub cache (pub
system_cache.dart):PUB_CACHE, else%LOCALAPPDATA%\Pub\Cacheon Windows, else~/.pub-cache; binstubs in itsbindirectory. - Dart data home (package
dart_data_home):DART_DATA_HOME, else the OS state directory forDart:%LOCALAPPDATA%\Dart,~/Library/Application Support/Dart,$XDG_STATE_HOME/Dartor~/.local/state/Dart.dart installuses itsinstalldirectory, with links (or.batwrappers) ininstall/binand app bundles ininstall/app-bundles.
Neither tool has a destination option: set PUB_CACHE or DART_DATA_HOME
before installing to change the location.
Constructors
-
DartToolPaths({required DartToolOs os, required Map<
String, String> environment}) -
Rules for
oswithenvironment.
Properties
- dartDataHomePath → String
-
The Dart data home.
no setter
- dartInstallAppBundlesPath → String
-
Where
dart installputs its app bundles (<package>/{hosted/<version>,git/<hash>,local}/bundle).no setter - dartInstallBinPath → String
-
Where
dart installputs its links (or.batwrappers on Windows).no setter - dartInstallPath → String
-
The
dart installdirectory.no setter -
environment
→ Map<
String, String> -
The environment variables used.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- homePath → String
-
The user home (
HOME, orUSERPROFILEon Windows).no setter - isWindows → bool
-
True on Windows.
no setter
- os → DartToolOs
-
The operating system.
final
-
pathEntries
→ List<
String> -
The
PATHentries, in order.no setter - pathSeparator → String
-
The
PATHseparator.no setter - pubCacheBinPath → String
-
Where
dart pub global activateputs its binstubs.no setter - pubCachePath → String
-
The pub cache.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
environmentValue(
String key) → String? - Environment value, case insensitive on Windows.
-
isDirOnPath(
String dir) → bool -
True if
diris onPATH. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pathIndexOf(
String dir) → int -
Index of
dirinPATH(trailing separators and case on Windows ignored), -1 if absent. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited