verifyLatestVersionFromPubSpec method Null safety

void verifyLatestVersionFromPubSpec()

Implementation

void verifyLatestVersionFromPubSpec() {
  try {
    File f = File(pathToYaml);
    // exit if no pubspec found so no warning in production
    if (!f.existsSync()) return;
    // compare meta.dart with pubspec meta and give warning if difference
    if (meta.keys
        .where((dynamic e) => (meta[e] != getPubSpec(e)))
        .isNotEmpty) {
      throw Exception(
          """Version number and other meta attributes in code are different from pubspec.yaml.  Please check pubspec.yaml and then run test so that MetaUpdate can update meta information in code, then recompile""");
    }
  } on Exception {
    rethrow;
  }
}