toJson method

  1. @override
Map<String, dynamic> toJson()

Implementation

@override
Map<String, dynamic> toJson() => {
      ...super.toJson(),
      'id': id,
      'chatId': chatId,
      'userId': userId,
      if (text != null) 'text': text,
      if (images != null && images!.isNotEmpty) 'images': images,
      if (replyId != null) 'replyId': replyId,
      if (geopoint != null && const [2, 3].contains(geopoint!.length))
        'geopoint': geopoint,
      if (payload != null) 'payload': payload,
    };