setVersion method
Implementation
Future<void> setVersion({
required Version version,
}) async {
final pubspec = this.pubspec;
final pubspecContent = await pubspec.readAsString();
final edited = pubspecContent.replaceFirst(
'version: ${this.version}',
'version: $version',
);
await pubspec.writeAsString(edited);
}