fetchSdks function

Map fetchSdks(
  1. Context context
)

Implementation

Map fetchSdks(Context context) {
  final String yamlFilePath = context.pubspecPath;
  final String yamlKeyName = context.yamlKeyName;

  final Map yamlData = readYamlFile(yamlFilePath);
  final Map? yamlKeyData = yamlData[yamlKeyName];

  if (yamlKeyData == null) {
    throw Exception(
        "Your pubspec.yaml file must have a key ${yamlKeyName} in it.");
  }
  return yamlKeyData as Map;
}