fromJson static method

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

Implementation

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

  switch (json['@type']) {
    case StickerTypeCustomEmoji.constructor:
      return StickerTypeCustomEmoji.fromJson(json);

    case StickerTypeMask.constructor:
      return StickerTypeMask.fromJson(json);

    case StickerTypeRegular.constructor:
      return StickerTypeRegular.fromJson(json);

    default:
      return null;
  }
}