UserProfile class abstract

UserProfile represents a valid user as mapped out from the backend In the event the backend mapping changes, this model should also change as well

Available extensions
Annotations
  • @Freezed(makeCollectionsUnmodifiable: false)

Constructors

UserProfile.new({@JsonKey(name: 'id') String? id, @JsonKey(name: 'userName') Name? username, @JsonKey(name: 'primaryPhone') PhoneNumber? primaryPhoneNumber, @JsonKey(name: 'primaryEmailAddress') EmailAddress? primaryEmailAddress, @JsonKey(name: 'secondaryPhoneNumbers') List<PhoneNumber>? secondaryPhoneNumbers, @JsonKey(name: 'secondaryEmailAddresses') List<EmailAddress>? secondaryEmailAddresses, @JsonKey(name: 'terms_accepted') bool? termsAccepted, @JsonKey(name: 'suspended') bool? suspended, @JsonKey(name: 'photoUploadID') String? photoUploadID, @JsonKey(name: 'covers') List<Cover?>? covers, @JsonKey(name: 'userBioData') BioData? userBioData, @JsonKey(name: 'homeAddress') Address? homeAddress, @JsonKey(name: 'workAddress') Address? workAddress, @JsonKey(name: 'referralLink') String? referralLink, @JsonKey(name: 'assistant', unknownEnumValue: Assistant.BEV) Assistant? assistant})
factory
UserProfile.fromJson(Map<String, dynamic> json)
factory
UserProfile.initial()
factory

Properties

assistant Assistant?
assistant refers to the name of the Be.Well user assistant, i.e Bev or Bowi.
no setterinherited
copyWith → $UserProfileCopyWith<UserProfile>
Create a copy of UserProfile with the given fields replaced by the non-null parameter values.
no setterinherited
covers List<Cover?>?
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
homeAddress Address?
no setterinherited
id String?
no setterinherited
photoUploadID String?
no setterinherited
primaryEmailAddress EmailAddress?
no setterinherited
primaryPhoneNumber PhoneNumber?
no setterinherited
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secondaryEmailAddresses List<EmailAddress>?
no setterinherited
secondaryPhoneNumbers List<PhoneNumber>?
no setterinherited
suspended bool?
no setterinherited
termsAccepted bool?
no setterinherited
userBioData BioData?
no setterinherited
username Name?
no setterinherited
workAddress Address?
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_UserProfile value)) → TResult

Available on UserProfile, provided by the UserProfilePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_UserProfile value)?) → TResult?

Available on UserProfile, provided by the UserProfilePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_UserProfile value)?, {required TResult orElse()}) → TResult

Available on UserProfile, provided by the UserProfilePatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String? id, Name? username, PhoneNumber? primaryPhoneNumber, EmailAddress? primaryEmailAddress, List<PhoneNumber>? secondaryPhoneNumbers, List<EmailAddress>? secondaryEmailAddresses, bool? termsAccepted, bool? suspended, String? photoUploadID, List<Cover?>? covers, BioData? userBioData, Address? homeAddress, Address? workAddress, String? referralLink, Assistant? assistant)?, {required TResult orElse()}) → TResult

Available on UserProfile, provided by the UserProfilePatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this UserProfile to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String? id, Name? username, PhoneNumber? primaryPhoneNumber, EmailAddress? primaryEmailAddress, List<PhoneNumber>? secondaryPhoneNumbers, List<EmailAddress>? secondaryEmailAddresses, bool? termsAccepted, bool? suspended, String? photoUploadID, List<Cover?>? covers, BioData? userBioData, Address? homeAddress, Address? workAddress, String? referralLink, Assistant? assistant)) → TResult

Available on UserProfile, provided by the UserProfilePatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String? id, Name? username, PhoneNumber? primaryPhoneNumber, EmailAddress? primaryEmailAddress, List<PhoneNumber>? secondaryPhoneNumbers, List<EmailAddress>? secondaryEmailAddresses, bool? termsAccepted, bool? suspended, String? photoUploadID, List<Cover?>? covers, BioData? userBioData, Address? homeAddress, Address? workAddress, String? referralLink, Assistant? assistant)?) → TResult?

Available on UserProfile, provided by the UserProfilePatterns extension

A variant of when that fallback to returning null

Operators

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