getPubspecContents function

Future<String> getPubspecContents()

Implementation

Future<String> getPubspecContents() async {
  final file = File('pubspec.yaml');
  if (!file.existsSync()) {
    throw StateError('pubspec.yaml does not exist');
  }
  return file.readAsString();
}