ImagePackImageContent.fromJson constructor

ImagePackImageContent.fromJson(
  1. Map<String, Object?> json
)

Implementation

ImagePackImageContent.fromJson(Map<String, Object?> json)
    : _json = Map.fromEntries(json.entries
          .where((e) => !['url', 'body', 'info'].contains(e.key))),
      url = Uri.parse(json['url'] as String),
      body = json.tryGet('body'),
      info = json.tryGetMap<String, Object?>('info'),
      usage = imagePackUsageFromJson(json.tryGetList<String>('usage'));