UserProfileModel class

Inheritance
Annotations
  • @JsonSerializable.new(explicitToJson: true)

Constructors

UserProfileModel({String id = '', required String username, required String email, String? bio, String? avatarUrl, UserRole? role, AccountVerificationStatus? verificationStatus, DateTime? createdAt, DateTime? updatedAt})
UserProfileModel.fromFirestore(DocumentSnapshot<Object?> doc)
factory
UserProfileModel.fromJson(Map<String, dynamic> json)
factory

Properties

avatarUrl String?
final
bio String?
final
createdAt DateTime?
final
email String
final
hashCode int
The hash code for this object.
no setterinherited
id String
final
role UserRole?
Nullable role - if server adds new role, old app gets null
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
updatedAt DateTime?
final
username String
final
verificationStatus AccountVerificationStatus?
Optional verification status
final

Methods

copyWith({String? id, String? username, String? email, String? bio, String? avatarUrl, UserRole? role, AccountVerificationStatus? verificationStatus, DateTime? createdAt, DateTime? updatedAt}) UserProfileModel
getCreateTimestampFields() List<String>
Fields that should only be set on document creation (like createdAt).
override
getUpdateTimestampFields() List<String>
Fields that should always be updated with server timestamp (like updatedAt).
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postProcessJson(Map<String, dynamic> json, SerializationContext context) Map<String, dynamic>
Override to add custom post-processing for specific models.
inherited
toCallable() Map<String, dynamic>
Convert for Firebase callable functions.
inherited
toFirestore({bool isUpdate = false}) Map<String, dynamic>
Legacy method for Firestore conversion.
inherited
toFirestoreCreate({bool useServerTimestamp = true, List<String>? fieldsToExclude}) Map<String, dynamic>
Convert to Firestore document for CREATE operations.
inherited
toFirestoreRaw({List<String>? fieldsToExclude}) Map<String, dynamic>
Convert to Firestore with explicit control (advanced use).
inherited
toFirestoreUpdate({List<String>? fieldsToExclude}) Map<String, dynamic>
Convert to Firestore document for UPDATE operations.
inherited
toJson() Map<String, dynamic>
The single generated toJson method from json_serializable. This should be implemented by the generated code.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited