toCompactJson method

Map<String, dynamic> toCompactJson()

Converts the message to a compact JSON map.

Implementation

Map<String, dynamic> toCompactJson() {
  try {
    final Map<String, dynamic> data = {};
    data["type"] = type;
    data["from"] = from;
    data["createdTime"] = createdTime;
    data["expiresTime"] = expiresTime;
    data["body"] = {
      "i": initiator.toCompactJson(),
      "c": context.toCompactJson(),
    };
    return data;
  } catch (e) {
    rethrow;
  }
}