pubspec_manager library

Classes

Comments
Used to hold the comments that prefix a section. A comment section is all the comments/blank lines that are above a section that are not owned by a (prior) section.
Dependencies
Used to hold a list of Dependencys from a single dependency section in the pubspec.yaml
Dependency
Base class for each of the Dependency types. This is an abstract class that should not be used directly
DependencyAltHosted
A dependency hosted on an alternate dart repository (such as onepub-web.flutter-io.cn).
DependencyBuilder
Base class for each of the DependencyBuilder types. Don't use this class directly.
DependencyBuilderAltHosted
A builder that generates an DependencyAltHosted ready to be attached to the pubspec. If no version is specified then 'any' is assumed.
DependencyBuilderGit
Git style dependency.
DependencyBuilderPath
represents a dependency that has a 'path' key A path dependency is located on the local file system. The path is a relative or absolute path to the dependant package. A path dependency takes the form of: dependencies: dcli: path: ../dcli
DependencyBuilderPubHosted
A dependench hosted on pub-web.flutter-io.cn. A pub hosted dependency is of the form dependencies: dcli: ^3.0.1
DependencyBuilderSdk
represents a dependency that has a 'path' key A path dependency is located on the local file system. The path is a relative or absolute path to the dependant package. A path dependency takes the form of: dependencies: dcli: path: ../dcli
DependencyGit
A dependency that is hosted in a git repository
DependencyPath
represents a dependency that has a 'path' key A path dependency is located on the local file system. The path is a relative or absolute path to the dependant package. A path dependency takes the form of: dependencies: dcli: path: ../dcli
DependencyPubHosted
A dependench hosted on pub-web.flutter-io.cn. A pub hosted dependency is of the form dependencies: dcli: ^3.0.1
DependencySdk
represents a dependency that has a 'path' key A path dependency is located on the local file system. The path is a relative or absolute path to the dependant package. A path dependency takes the form of: dependencies: flutter: sdk: flutter
DependencyVersioned
Some dependency define a package version number Dependencies that do so must implement this interface.
Description
Describes the pubspec 'description' key and allows you to manage the contents of the description key
Document
A line based representation of the underlying pubpsec.yaml. The Document holds a Line for each line in the pubspec.yaml. Any changes via the pubspec_manager api result in changes to the list of _lines. You can use the Document to access settings that are outside of the pubspec specification.
Documentation
Holds the url for the 'documentation' key.
Environment
Holds the details of the environment section. i.e. flutter and sdk versions. To set/update the environment use:
EnvironmentBuilder
Used to build an Environment when constructing a PubSpec.
Executable
A package executable that will be added to the user's PATh when the globally activate the package.
Executables
Used to hold the list of Executables under 'executables' key. To add additinal executables use:
Homepage
Defines the url to the package's homepage.
IssueTracker
Describes the url of the package's issue tracker.
Line
Represents a line of text in the Document that is used to load and manipulate the pubspec.yaml.
Name
Describes the name of the package.
Platforms
Holds a list of supported platforms listed under the 'platforms' keyword.
PlatformSupport
A platform that the package supports.
PublishTo
Describes the dart repository that this package is published to. If not set then a publish attempt will publish the package to 'pub-web.flutter-io.cn'. To stop a package being accidently published you should set the 'publish_to' value to 'none'.
PubSpec
A representation of the loaded or created pubspec.yaml. All operations start here.
Repository
Section
A section that may have children and comments. Represents a section of a pubspec such as a dependency and all lines attached to the dependency Sections may be nested - e.g. The dependency key is a section as are each dependency under it.
SingleLine
Version
Holds package version as declared in the pubspec.yaml
VersionConstraint
Holds a dependency version
VersionConstraintBuilder
Holds a dependency version
Writer

Enums

LineType
Each line read from the pubspec.yaml is assigned a LineType
PlatformEnum

Typedefs

Key = String

Exceptions / Errors

DependencyNotFound
Thrown when you try to access a dependency by name and that dependency doesn't exist.
DuplicateKeyException
ExecutableNotFound
Thrown when you try to access an executable by name and that executable doesn't exist.
FundingLinkNotFound
Thrown when you try to access an funding link by name and that funding link doesn't exist.
NotFoundException
Thrown when the pubspec file can't be found.
OutOfBoundsException
PlatformNotFound
Thrown when you try to access a platform by name and that platform doesn't exist.
PubSpecException
All exceptions throw from this package are based on this exception.
VersionException
Thrown when an invalid version is passed.