neo_pubspec 1.2.0 copy "neo_pubspec: ^1.2.0" to clipboard
neo_pubspec: ^1.2.0 copied to clipboard

discontinuedreplaced by: pubspec

Resolve Dart or Flutter project from directory and read pubspec.yaml.

example/lib/main.dart

import 'dart:io';

import 'package:neo_pubspec/neo_pubspec.dart';

void main() async {
  // Read existed pubspec.yaml
  PubspecProjectManager ppm = PubspecProjectManager(Directory("./"));
  PubspecInfo info = await ppm.extractPubspecData;
  print(info.toMap());

  // Call upgrade
  print(await ppm.upgradePubspec());

  // Add package
  info.dependencies
      .add(HostedPackageDependency(name: "path", version: "^1.8.0"));

  // Print updated package
  print(info.toMap());

  // Save pubspec
  await ppm.savePubspecInfo(info);

  // Get package
  print(await ppm.getPubspec());

  // Remove package
  info.dependencies.remove("path");

  // Save pubspec
  await ppm.savePubspecInfo(info);

  // Get package
  print(await ppm.getPubspec());
}
0
likes
90
points
6
downloads

Publisher

unverified uploader

Weekly Downloads

Resolve Dart or Flutter project from directory and read pubspec.yaml.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

ansicolor, json2yaml, path, pub_semver, yaml

More

Packages that depend on neo_pubspec