PubspecEditor class

A simple editor for pubspec.yaml files to manage dependencies.

Constructors

PubspecEditor(String pubspecContent)
Creates a PubspecEditor with the given pubspecContent.

Properties

hashCode int
The hash code for this object.
no setterinherited
pubspecContent String
The original content of the pubspec.yaml file.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addPathDependency(String packageName, String path) bool
Adds a path dependency for packageName at the given path.
hasDependency(String packageName) bool
Checks if the pubspec has a dependency on packageName.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeDependency(String packageName) bool
Removes the dependency on packageName.
save(File file) bool
Saves the current YAML content to the given file. Returns true if the save was successful, false otherwise.
toString() String
A string representation of this object.
inherited
toYamlString() String
Returns the current YAML content as a string.

Operators

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