getPubspecVersion method

Future<String> getPubspecVersion()

Implementation

Future<String> getPubspecVersion() async {
  final file = File(p.join(projectDir, 'pubspec.yaml'));
  final yaml = loadYaml(await file.readAsString());
  return yaml['version']?.toString() ?? '1.0.0';
}