toJson method
Generates a map representing the User
.
Implementation
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['uid'] = uid;
map['name'] = name;
map['link'] = link;
map['avatar'] = avatar;
if (metadata != null) {
map['metadata'] = metadata;
}
map['status'] = status;
map['role'] = role;
map['statusMessage'] = statusMessage;
map['tags'] = tags;
map['hasBlockedMe'] = hasBlockedMe;
map['blockedByMe'] = blockedByMe;
map['lastActiveAt'] =
lastActiveAt == null ? 0 : lastActiveAt?.millisecondsSinceEpoch;
return map;
}