PubspecService class
Provides utilities for updating the project's pubspec.yaml file.
Supports adding dependencies, configuring Flutter localization generation, saving changes, and running dependency resolution after modifications.
Constructors
- PubspecService()
- Creates a service for managing the project's pubspec configuration.
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
-
ensureDependencies(
Map< String, String> packages) → Future<void> -
Ensures that all provided
packagesexist in the project dependencies. -
ensureDependency(
String package, {String version = 'any', bool ensureLoaded = false}) → Future< void> -
Ensures that
packageexists in the project's dependencies. -
ensureDevDependencies(
Map< String, String> packages) → Future<void> -
Ensures that all provided
packagesexist in the development dependencies. -
ensureDevDependency(
String package, {String version = 'any', bool ensureLoaded = false}) → Future< void> -
Ensures that
packageexists in the project's development dependencies. -
ensureFlutterGenerate(
) → Future< void> -
Ensures that Flutter code generation is enabled in
pubspec.yaml. -
ensureFlutterSdkDependency(
String package) → Future< void> -
Ensures that
packageexists as a Flutter SDK dependency. -
ensureLocalization(
) → Future< void> - Ensures that the project is configured for Flutter localization.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
) → Future< void> -
Saves pending changes to
pubspec.yaml. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited