getAppName function
Implementation
Future<String> getAppName() async {
final pubspecContents = await getPubspecContents();
final yaml = loadYaml(pubspecContents) as Map;
final name = yaml['name'];
if (name is! String) {
throw StateError('Invalid name property in pubspec.yaml');
}
return name;
}