create static method

Sticker create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "sticker",
  3. String? url,
  4. String? filesha256,
  5. String? fileencsha256,
  6. String? mediakey,
  7. String? mimetype,
  8. num? height,
  9. num? width,
  10. String? directpath,
  11. String? filelength,
  12. String? mediakeytimestamp,
  13. bool? isanimated,
  14. ContextInfo? contextinfo,
  15. String? stickersentts,
  16. bool? isavatar,
})
override

Generated

Implementation

static Sticker create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "sticker",
  String? url,
  String? filesha256,
  String? fileencsha256,
  String? mediakey,
  String? mimetype,
  num? height,
  num? width,
  String? directpath,
  String? filelength,
  String? mediakeytimestamp,
  bool? isanimated,
  ContextInfo? contextinfo,
  String? stickersentts,
  bool? isavatar,
}) {
  // Sticker sticker = Sticker({
  final Map sticker_data_create_json = {
    "@type": special_type,
    "url": url,
    "fileSha256": filesha256,
    "fileEncSha256": fileencsha256,
    "mediaKey": mediakey,
    "mimetype": mimetype,
    "height": height,
    "width": width,
    "directPath": directpath,
    "fileLength": filelength,
    "mediaKeyTimestamp": mediakeytimestamp,
    "isAnimated": isanimated,
    "contextInfo": (contextinfo != null) ? contextinfo.toJson() : null,
    "stickerSentTs": stickersentts,
    "isAvatar": isavatar,
  };

  sticker_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (sticker_data_create_json.containsKey(key) == false) {
        sticker_data_create_json[key] = value;
      }
    });
  }
  return Sticker(sticker_data_create_json);
}