getCurrentVersions method

Map<String, String> getCurrentVersions()

Returns current dependency versions from pubspec.

Implementation

Map<String, String> getCurrentVersions() {
  final pubspec = parsePubspec('$projectPath/pubspec.yaml');
  if (pubspec == null) return {};

  final versions = <String, String>{};
  versions.addAll(getDependencyVersions(pubspec));
  versions.addAll(getDevDependencyVersions(pubspec));
  return versions;
}