toJson method

Map<String, dynamic> toJson()

Convert to JSON.

Implementation

Map<String, dynamic> toJson() => {
      'conversation': conversation.toJson(),
      'type': type,
      if (text != null) 'text': text,
      if (blocks != null) 'blocks': blocks,
      if (attachments != null)
        'attachments': attachments!.map((a) => a.toJson()).toList(),
      if (replyTo != null) 'replyTo': replyTo,
      if (options != null) 'options': options,
    };