Sticker.fromJson constructor
Creates a Sticker object from JSON object
Implementation
factory Sticker.fromJson(Map<String, dynamic> json) {
return Sticker(
fileId: json['file_id'] as String,
fileUniqueId: json['file_unique_id'] as String,
type: StickerType.fromJson(json['type'] as String),
width: json['width'] as int,
height: json['height'] as int,
isAnimated: json['is_animated'] as bool,
isVideo: json['is_video'] as bool,
thumbnail: json['thumbnail'] == null
? null
: PhotoSize.fromJson(json['thumbnail'] as Map<String, dynamic>),
emoji: json['emoji'] as String?,
setName: json['set_name'] as String?,
premiumAnimation: json['premium_animation'] == null
? null
: File.fromJson(json['premium_animation'] as Map<String, dynamic>),
maskPosition: json['mask_position'] == null
? null
: MaskPosition.fromJson(
json['mask_position'] as Map<String, dynamic>,
),
customEmojiId: json['custom_emoji_id'] as String?,
fileSize: json['file_size'] as int?,
needsRepainting: json['needs_repainting'] as bool?,
);
}