PubSpec class Null safety
Used to read a pubspec.yaml file
Constructors
- PubSpec.fromFile(String path)
-
Reads a pubspec.yaml located at
path
- PubSpec.fromScript(DartScript script)
-
Reads a pubspec.yaml from the path that
script
is located in. - PubSpec.fromString(String yamlString)
-
parses a pubspec from a yaml string.
factory
Properties
-
dependencies
↔ Map<
String, Dependency> -
Returns an unmodifiable map of the dependencies
If you need to update the map pass a new map
with the updated values.
read / write
-
dependencyOverrides
↔ Map<
String, Dependency> -
Returns an unmodifiable map of the dependency overrides
If you need to update the map pass a new map
with the updated values.
read / write
-
executables
→ List<
Executable> -
Get the list of exectuables
read-only
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- name ↔ String?
-
Returns the name field from the pubspec.yaml
read / write
- pubspec ↔ PubSpec
-
the wrapped pubspec.
read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
- version ↔ Version?
-
Returns the version field from the pubspec.yaml
read / write
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
saveToFile(
String path) → void -
Saves this PubSpec to a pubspec.yaml at the given
path
. Thepath
must be a directory not a file name. -
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited
Static Methods
-
createPathReference(
String path) → PathReference -
equals(
PubSpec lhs, PubSpec rhs) → bool - Compares two pubspec to see if they have the same content.