onepub-dev / pubspec_manager

Eric lets you read, modify and write pubspec.yaml files whilst preserving comments and everything else.
MIT License
5 stars 3 forks source link

Supports custom field acquisition and setting #13

Open laterdayi opened 2 weeks ago

laterdayi commented 2 weeks ago

Supports custom field acquisition and setting

name: 'name'
description: "A new Flutter project."
publish_to: "none"
test: 'test',
test1: 'test1'
bsutton commented 2 weeks ago

You already do this via the Document level api, though perhaps a little crudely.

https://pub.dev/documentation/pubspec_manager/latest/pubspec_manager/Document-class.html

laterdayi commented 2 weeks ago

Can you roughly describe which API I should use? It seems a bit confusing now.

bsutton commented 2 weeks ago
final pubspec  = PubSpec.load();
pubspec.document.getLineForKey('test1');