CallEvent.fromJson constructor
CallEvent.fromJson(
- Map<String, dynamic> json
)
Implementation
factory CallEvent.fromJson(Map<String, dynamic> json) {
return CallEvent(
id: json["id"]?.toString() ?? "",
isGroup: json["isGroup"] == true || json["isGroup"]?.toString() == "true",
isVideo: json["isVideo"] == true || json["isVideo"]?.toString() == "true",
offerTime: json["offerTime"] is int
? json["offerTime"]
: (int.tryParse(json["offerTime"]?.toString() ?? "0") ?? 0),
sender: json["sender"]?.toString() ?? "",
peerJid: json["peerJid"]?.toString() ?? "",
);
}