Sticker.fromJson constructor

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

Parse from a json

Implementation

factory Sticker.fromJson(Map<String, dynamic> json) => Sticker(
      id: int.tryParse(json['id'] ?? "") ?? 0,
      setId: int.tryParse(json['set_id'] ?? "") ?? 0,
      width: json['width'],
      height: json['height'],
      emoji: json['emoji'],
      format: StickerFormat.fromJson(json['format']),
      fullType: StickerFullType.fromJson(json['full_type']),
      outline: List<ClosedVectorPath>.from((json['outline'] ?? [])
          .map((item) => ClosedVectorPath.fromJson(item))
          .toList()),
      thumbnail: json['thumbnail'] == null
          ? null
          : Thumbnail.fromJson(json['thumbnail']),
      sticker: File.fromJson(json['sticker']),
      extra: json['@extra'],
      clientId: json['@client_id'],
    );