toJson method

Map<String, dynamic> toJson()

Converts to JSON

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'email': email,
    if (name != null) 'name': name,
    'roles': roles,
    'emailVerified': emailVerified,
    if (createdAt != null) 'createdAt': createdAt!.toIso8601String(),
    if (updatedAt != null) 'updatedAt': updatedAt!.toIso8601String(),
    if (metadata != null) 'metadata': metadata,
  };
}