toJson property

Map<String, dynamic> toJson

Implementation

Map<String, dynamic> get toJson {
  Map<String, dynamic> messageJs = {
    "title": title,
    "body": body,
    "tag": id,
    "largImage": largeImage,
    "payload": json.encode(toJs),
  };
  if (image != null) {
    messageJs["image"] = image!;
  }
  if (launch != null) {
    messageJs["launch"] = launch;
  }
  if (group != null) {
    messageJs["group"] = group;
  }
  return messageJs;
}