jsonMap method
Implementation
@override
Map<String, Object> jsonMap({bool serializeChannel: false}) {
Map<String, Object> map = new Map<String, Object>()..['userId'] = userId;
if (name != null) {
map['name'] = name!;
}
if (lastSeen != null) {
map['lastSeen'] = lastSeen!.toIso8601String();
}
if (lastChannel != null) {
map['channel'] =
(serializeChannel ? lastChannel!.jsonMap() : lastChannel!.channelId);
}
return map;
}