PubspecYaml class

PubspecYaml is a data type representing data stored in pubspec.yaml files. See https://dart.dev/tools/pub/pubspec for details It provides the following facilities:

Inheritance
Annotations
  • @immutable
  • @FunctionalData()

Constructors

PubspecYaml({required String name, Optional<String> version = const Optional.none(), Optional<String> description = const Optional.none(), List<String> authors = const [], Optional<String> homepage = const Optional.none(), Optional<String> repository = const Optional.none(), Optional<String> issueTracker = const Optional.none(), Optional<String> documentation = const Optional.none(), Optional<String> publishTo = const Optional.none(), Iterable<PackageDependencySpec> dependencies = const [], Iterable<PackageDependencySpec> devDependencies = const [], Iterable<PackageDependencySpec> dependencyOverrides = const [], Map<String, String> environment = const {}, Map<String, Optional<String>> executables = const {}, Map<String, dynamic> customFields = const <String, dynamic>{}})
Default constructor
const
PubspecYaml.loadFromYamlString(String content)
Imports PubspecYaml from a YAML string
factory

Properties

authors List<String>
Package authors (https://dart.dev/tools/pub/pubspec)
final
customFields Map<String, dynamic>
JSON representation of other pubspec.yaml fields
final
dependencies Iterable<PackageDependencySpec>
Regular dependencies that anyone using the package will also need https://dart.dev/tools/pub/pubspec#dependencies https://dart.dev/tools/pub/dependencies
final
dependencyOverrides Iterable<PackageDependencySpec>
Temporarily override all references to a dependency https://dart.dev/tools/pub/pubspec#dependencies https://dart.dev/tools/pub/dependencies
final
description → Optional<String>
Package description (https://dart.dev/tools/pub/pubspec#description)
final
devDependencies Iterable<PackageDependencySpec>
Dependencies that are only needed in the development phase of the package https://dart.dev/tools/pub/pubspec#dependencies https://dart.dev/tools/pub/dependencies
final
documentation → Optional<String>
Site that hosts documentation, separate from the main homepage and from the Pub-generated API reference https://dart.dev/tools/pub/pubspec#documentation
final
environment Map<String, String>
SDK constraints https://dart.dev/tools/pub/pubspec#sdk-constraints
final
executables Map<String, Optional<String>>
Executables that can be run directly from the command line https://dart.dev/tools/pub/pubspec#executables
final
hashCode int
The hash code for this object.
no setterinherited
homepage → Optional<String>
URL pointing to the package website (https://dart.dev/tools/pub/pubspec#homepage)
final
issueTracker → Optional<String>
URL for the package’s issue tracker, where existing bugs can be viewed and new bugs can be filed https://dart.dev/tools/pub/pubspec#issue-tracker
final
name String
Package name (https://dart.dev/tools/pub/pubspec#name)
final
publishTo → Optional<String>
This setting can be used to specify a custom pub package server to publish. The default uses the pub.dev site. Specify none to prevent a package from being published. https://dart.dev/tools/pub/pubspec#publish_to
final
repository → Optional<String>
URL for package’s source code repository (https://dart.dev/tools/pub/pubspec#repository)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
version → Optional<String>
Package version (https://dart.dev/tools/pub/pubspec#version)
final

Methods

copyUsing(void mutator(PubspecYaml$Change change)) PubspecYaml
inherited
copyWith({String? name, Optional<String>? version, Optional<String>? description, List<String>? authors, Optional<String>? homepage, Optional<String>? repository, Optional<String>? issueTracker, Optional<String>? documentation, Optional<String>? publishTo, Iterable<PackageDependencySpec>? dependencies, Iterable<PackageDependencySpec>? devDependencies, Iterable<PackageDependencySpec>? dependencyOverrides, Map<String, String>? environment, Map<String, Optional<String>>? executables, Map<String, dynamic>? customFields}) PubspecYaml
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
toYamlString() String
Exports PubspecYaml instance as a YAML string

Operators

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