LightMetadata.fromJson constructor

LightMetadata.fromJson(
  1. Map<String, dynamic> dataMap
)

Creates a LightMetadata object from the JSON response to a GET request.

Implementation

factory LightMetadata.fromJson(Map<String, dynamic> dataMap) {
  return LightMetadata(
    name: dataMap[ApiFields.name] ?? "",
    archetype: LightArchetype.fromString(dataMap[ApiFields.archetype] ?? ""),
    fixedMired: dataMap[ApiFields.fixedMired] ?? 153,
  );
}