ResourceIdentifiers.fromFileContents constructor

ResourceIdentifiers.fromFileContents(
  1. String fileContents
)

Read resources from the contents of a resources.json file

Implementation

factory ResourceIdentifiers.fromFileContents(String fileContents) {
  final fileJson = (jsonDecode(fileContents) as Map)['identifiers'] as List;
  return ResourceIdentifiers(
      identifiers: fileJson
          .map((e) => e as Map<String, Object?>)
          .map(Identifier.fromJson)
          .toList());
}