onepub-dev / pubspec_manager

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

Whether name can be made optional #6

Closed laterdayi closed 4 months ago

laterdayi commented 8 months ago

Whether name can be made optional

I have a scenario where I need to get the project pubspec.yaml file, get the version value and modify the version value, how will this be done

bsutton commented 4 months ago

I'm not certain how this relates to the name.

There is an example of this in the readme.

void updateVersion() {
  final pubspec = PubSpec.load();
  pubspec.version.set('1.2.1');
  pubspec.save();
}