toJson method

Map<String, dynamic> toJson()

Converts this User to a JSON map.

The returned map can be serialized to JSON for storage or transmission.

Implementation

Map<String, dynamic> toJson() {
  return {
    'id': id,
    'email': email,
    'name': name,
    'image': image,
    'emailVerified': emailVerified,
    'role': role,
    'createdAt': createdAt.toIso8601String(),
    'updatedAt': updatedAt.toIso8601String(),
    'metadata': metadata,
  };
}