fetchPermissions function

List<String> fetchPermissions(
  1. Context context
)

Implementation

List<String> fetchPermissions(Context context) {
  final yamlKeyName = context.yamlKeyName;
  final Map yamlData = getYamlKeyData(context);
  final yamlPermissions = yamlData["permissions"] as YamlList;

  final List<String>? permissions =
      yamlPermissions.toList().map((e) => e.toString()).toList();

  if (permissions == null) {
    throw Exception(
        "You must set the permissions array under the '${yamlKeyName}' section of your pubspec.yaml file.");
  }
  return permissions as List<String>;
}