PubspecUtils class
Reads and updates package metadata for the current project.
- Available extensions
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- extraFolder → bool?
-
Whether generated features should use an additional subfolder.
no setter
- getCliJson → dynamic
-
Decodes
.get_cli.yamlas YAML.no setter - getCliString → String
-
Returns the raw
.get_cli.yamlcontents.no setter - getPackageImport → String
-
Returns the Get import generated for the current project.
no setter
- isServerProject → bool
-
make sure it is a get_server project
no setter
- nullSafeSupport → bool
-
Whether the current project's SDK constraint supports null safety.
no setter
- projectName → String
-
Returns the current project's package name.
no setter
- pubSpec → Pubspec
-
Parses the current project's
pubspec.yaml.no setter - pubspecJson → dynamic
-
Decodes the current project's
pubspec.yamlas YAML.no setter - pubspecString → String
-
Returns the current project's raw
pubspec.yamlcontents.no setter - sdkVersionConstraint → VersionConstraint?
-
Returns the current project's Dart SDK constraint.
no setter
- separatorFileType → String?
-
Returns the configured filename separator, when one is set.
no setter
- tallStyle → bool
-
Whether generated code should use the Dart 3.7 tall style.
no setter
Static Methods
-
addDependencies(
String package, {String? version, bool isDev = false, bool runPubGet = true}) → Future< bool> -
Adds
packageto the current project's dependencies. -
containsPackage(
String package, [bool isDev = false]) → bool -
Whether
packageis declared by the current project. -
removeDependencies(
String package, {bool logger = true}) → Future< void> -
Removes
packagefrom the current project's dependencies.