parseFromFile static method

Future<Pubspec?> parseFromFile(
  1. String path,
  2. FileSystem fs
)

Implementation

static Future<Pubspec?> parseFromFile(String path, FileSystem fs) async {
  if (!fs.exists(path)) return null;
  try {
    final content = await fs.readAsStringAsync(path);
    return parse(content);
  } catch (_) {
    return null;
  }
}