toMap method
Implementation
Map<String, dynamic> toMap() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['email'] = email;
data['username'] = username;
data['imageUrl'] = imageUrl;
if (chats != null) {
data['chats'] = chats?.map((v) => v.toJson()).toList();
}
data['platform'] = platform;
return data;
}