copy method

PubSpec copy({
  1. String? name,
  2. String? author,
  3. Version? version,
  4. String? homepage,
  5. String? documentation,
  6. String? description,
  7. Uri? publishTo,
  8. Environment? environment,
  9. Map<String, DependencyReference>? dependencies,
  10. Map<String, DependencyReference>? devDependencies,
  11. Map<String, DependencyReference>? dependencyOverrides,
  12. Map<String, Executable>? executables,
  13. Map? unParsedYaml,
})

creates a copy of the pubspec with the changes provided

Implementation

PubSpec copy(
    {String? name,
    String? author,
    Version? version,
    String? homepage,
    String? documentation,
    String? description,
    Uri? publishTo,
    Environment? environment,
    Map<String, DependencyReference>? dependencies,
    Map<String, DependencyReference>? devDependencies,
    Map<String, DependencyReference>? dependencyOverrides,
    Map<String, Executable>? executables,
    Map? unParsedYaml}) {
  return PubSpec(
      name: name ?? this.name,
      author: author ?? this.author,
      version: version ?? this.version,
      homepage: homepage ?? this.homepage,
      documentation: documentation ?? this.documentation,
      description: description ?? this.description,
      publishTo: publishTo ?? this.publishTo,
      environment: environment ?? this.environment,
      dependencies: dependencies ?? this.dependencies,
      devDependencies: devDependencies ?? this.devDependencies,
      dependencyOverrides: dependencyOverrides ?? this.dependencyOverrides,
      executables: executables ?? this.executables,
      unParsedYaml: unParsedYaml ?? this.unParsedYaml);
}