toJson method

Map<String, dynamic> toJson()

Converts this user to a JSON map.

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    if (username != null) 'username': username,
    if (image != null) 'image': image,
    if (tier != null) 'tier': tier,
    if (status != null) 'status': status,
    if (isModerator != null) 'isModerator': isModerator,
    if (createdAt != null) 'createdAt': createdAt!.toIso8601String(),
    if (displayName != null) 'displayName': displayName,
    if (filePreferences != null) 'filePreferences': filePreferences!.toJson(),
    if (banned != null && banned!) 'banned': banned,
  };
}