CachedResource.fromJson constructor

CachedResource.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory CachedResource.fromJson(Map<String, dynamic> json) {
  return CachedResource(
    url: json['url'] as String,
    type: ResourceType.fromJson(json['type'] as String),
    response: json.containsKey('response')
        ? ResponseData.fromJson(json['response'] as Map<String, dynamic>)
        : null,
    bodySize: json['bodySize'] as num,
  );
}