findPackage function

Future<Map<String, String>> findPackage ()

Implementation

Future<Map<String, String>> findPackage() async {
  print('finding packages');

  final pkgFileName = getPackageFileName();

  // get file from package name
  final pkgFile = await getPackageFile(pkgFileName);

  if (pkgFile == null) {
    return null;
  }

  // read file content
  final content = await readFile(pkgFile);

  // tranlates yaml file to json
  final contentJson = transYaml(content);

  return formatPackages(contentJson);
}