DartInstalledCliPackage class

A package installed with dart install, a line of dart installed [--all] (Dart 3.10+).

Shapes (verified with Dart 3.13):

  • hosted: webdev 4.0.3
  • git: my_tool 1.0.0 from Git repository "<url>" at "<8 char ref>"
  • path: my_tool 1.0.0 from "<path>" at 2026-09-28 17:06:49.116900
  • any of them followed by (not active) or another status in parentheses (only listed with --all).

Same parser as pubglobalupdate DartInstalledPackage.

Constructors

DartInstalledCliPackage({required String name, required Version version, required String source, String? gitUrl, String? gitRef, String? path, String? lastModified, String? status})
A parsed line.

Properties

active → bool
True when its executables are in the dart install bin directory.
no setter
gitRef → String?
Resolved git ref, 8 characters (git source).
final
gitUrl → String?
Git url (git source).
final
hashCode → int
The hash code for this object.
no setterinherited
lastModified → String?
Install time as printed (path source).
final
name → String
Package name.
final
path → String?
Package path as given at install time (path source).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
source → String
sourceHosted, sourceGit, sourcePath or sourceUnknown.
final
sourceValue → String?
The git url or the path.
no setter
status → String?
Status in parentheses, null when active (not active...).
final
version → Version
Installed version.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

fromLine(String line) → DartInstalledCliPackage?
Parses a dart installed line, null if it is not one (i.e. No Dart CLI tools installed.).

Constants

sourceGit → const String
Git source.
sourceHosted → const String
Hosted source (pub.dev).
sourcePath → const String
Path source.
sourceUnknown → const String
Unknown source.