fromJson static method

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

Implementation

static Sticker? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return Sticker(
    id: (json['id'] is int
            ? json['id'] as int
            : int.tryParse(json['id']?.toString() ?? '')) ??
        0,
    setId: (json['set_id'] is int
            ? json['set_id'] as int
            : int.tryParse(json['set_id']?.toString() ?? '')) ??
        0,
    width: (json['width'] as int?) ?? 0,
    height: (json['height'] as int?) ?? 0,
    emoji: (json['emoji'] as String?) ?? '',
    format: StickerFormat.fromJson(json['format'] as Map<String, dynamic>?)!,
    fullType:
        StickerFullType.fromJson(json['full_type'] as Map<String, dynamic>?)!,
    thumbnail: Thumbnail.fromJson(json['thumbnail'] as Map<String, dynamic>?),
    sticker: File.fromJson(json['sticker'] as Map<String, dynamic>?)!,
  );
}