1
import 'package:vkdart/vkontakte.dart';
5
/// See https://vk.com/dev/objects/sticker
6
class StickerAttachmentModel extends AttachmentModel {
7
// ignore: public_member_api_docs
8
StickerAttachmentModel(super.payload) : super(attachType: 'sticker');
10
/// The ID of the set.
11
int get productId => payload['product_id'];
14
int get stickerId => payload['sticker_id'];
16
/// Sticker images (with transparent background).
17
List<StickerAttachmentImageModel> get images => (payload['images'] as List)
19
// ignore: require_trailing_commass
20
StickerAttachmentImageModel((e as Map).cast<String, dynamic>()))
23
/// Images for the sticker (with an opaque background).
24
List<StickerAttachmentImageModel> get imagesWithBackground =>
25
(payload['images_with_background'] as List)
27
// ignore: require_trailing_commass
28
StickerAttachmentImageModel((e as Map).cast<String, dynamic>()))
31
/// The URL of the sticker animation.
32
String? get animationUrl => payload['animation_url'];
34
/// Whether the sticker is allowed.
35
bool? get isAllowed => payload['is_allowed'];
38
/// Model Sticker Attachment Image.
40
/// See https://vk.com/dev/objects/sticker#image
41
final class StickerAttachmentImageModel {
42
// ignore: public_member_api_docs
43
StickerAttachmentImageModel(this.imageObject);
46
final Map<String, dynamic> imageObject;
48
/// Sticker image url.
49
String get url => imageObject['url'];
51
/// Sticker image width.
52
String get width => imageObject['width'];
54
/// Sticker image height.
55
String get height => imageObject['height'];