User class abstract
- Available extensions
- Annotations
-
- @freezed
Constructors
-
User.new({@Default('') @JsonKey(name: 'id') String userId, @Default('') @JsonKey(name: 'healthID') String healthId, @Default('') @JsonKey(name: 'username') String username, @Default('') @JsonKey(name: 'name') String name, @Default('') @JsonKey(name: 'firstName') String firstName, @Default('') @JsonKey(name: 'lastName') String lastName, @Default('') @JsonKey(name: 'nationalID') String nationalID, @Default('') @JsonKey(name: 'dateOfBirth') String dateOfBirth, @Default(Gender.unknown) @JsonKey(name: 'gender', fromJson: genderFromJson, toJson: genderToJson) Gender gender, @Default('') @JsonKey(name: 'avatar') String avatar, @JsonKey(name: 'contacts') Contact? primaryContact, @Default(<Contact>[]) @JsonKey(name: 'secondaryContacts') List<
Contact> secondaryContacts, @Default('') @JsonKey(name: 'email') String email, @Default(<String>[]) @JsonKey(name: 'languages') List<String> languages, @Default('') @JsonKey(name: 'currentOrganizationID') String currentOrganizationID, @Default('') @JsonKey(name: 'currentProgramID') String currentProgramID, @Default(false) @JsonKey(name: 'active') bool active, @Default(false) @JsonKey(name: 'termsAccepted') bool termsAccepted, @Default(false) @JsonKey(name: 'hasSetPin') bool hasSetPin, @Default(false) @JsonKey(name: 'hasSetNickname') bool hasSetNickname, @Default(false) @JsonKey(name: 'isPhoneVerified') bool isPhoneVerified, @Default(false) @JsonKey(name: 'pinChangeRequired') bool pinChangeRequired, @Default(false) @JsonKey(name: 'pinUpdateRequired') bool pinUpdateRequired, @Default(false) @JsonKey(name: 'suspended') bool suspended, @Default('') String streamToken}) -
factory
-
User.fromJson(Map<
String, dynamic> json) -
factory
- User.initial()
-
factory
Properties
- active → bool
-
no setterinherited
- avatar → String
-
no setterinherited
-
copyWith
→ $UserCopyWith<
User> -
Create a copy of User
with the given fields replaced by the non-null parameter values.
no setterinherited
- currentOrganizationID → String
-
no setterinherited
- currentProgramID → String
-
no setterinherited
- dateOfBirth → String
-
no setterinherited
- email → String
-
no setterinherited
- firstName → String
-
no setterinherited
- gender → Gender
-
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasSetNickname → bool
-
no setterinherited
- hasSetPin → bool
-
no setterinherited
- healthId → String
-
no setterinherited
- isPhoneVerified → bool
-
no setterinherited
-
languages
→ List<
String> -
no setterinherited
- lastName → String
-
no setterinherited
- name → String
-
no setterinherited
- nationalID → String
-
no setterinherited
- pinChangeRequired → bool
-
no setterinherited
- pinUpdateRequired → bool
-
no setterinherited
- primaryContact → Contact?
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
secondaryContacts
→ List<
Contact> -
no setterinherited
- streamToken → String
-
no setterinherited
- suspended → bool
-
no setterinherited
- termsAccepted → bool
-
no setterinherited
- userId → String
-
no setterinherited
- username → String
-
no setterinherited
Methods
-
map<
TResult extends Object?> (TResult $default(_User value)) → TResult -
Available on User, provided by the UserPatterns extension
Aswitch
-like method, using callbacks. -
mapOrNull<
TResult extends Object?> (TResult? $default(_User value)?) → TResult? -
Available on User, provided by the UserPatterns extension
A variant ofmap
that fallback to returningnull
. -
maybeMap<
TResult extends Object?> (TResult $default(_User value)?, {required TResult orElse()}) → TResult -
Available on User, provided by the UserPatterns extension
A variant ofmap
that fallback to returningorElse
. -
maybeWhen<
TResult extends Object?> (TResult $default(String userId, String healthId, String username, String name, String firstName, String lastName, String nationalID, String dateOfBirth, Gender gender, String avatar, Contact? primaryContact, List< Contact> secondaryContacts, String email, List<String> languages, String currentOrganizationID, String currentProgramID, bool active, bool termsAccepted, bool hasSetPin, bool hasSetNickname, bool isPhoneVerified, bool pinChangeRequired, bool pinUpdateRequired, bool suspended, String streamToken)?, {required TResult orElse()}) → TResult -
Available on User, provided by the UserPatterns extension
A variant ofwhen
that fallback to anorElse
callback. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes this User to a JSON map.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> (TResult $default(String userId, String healthId, String username, String name, String firstName, String lastName, String nationalID, String dateOfBirth, Gender gender, String avatar, Contact? primaryContact, List< Contact> secondaryContacts, String email, List<String> languages, String currentOrganizationID, String currentProgramID, bool active, bool termsAccepted, bool hasSetPin, bool hasSetNickname, bool isPhoneVerified, bool pinChangeRequired, bool pinUpdateRequired, bool suspended, String streamToken)) → TResult -
Available on User, provided by the UserPatterns extension
Aswitch
-like method, using callbacks. -
whenOrNull<
TResult extends Object?> (TResult? $default(String userId, String healthId, String username, String name, String firstName, String lastName, String nationalID, String dateOfBirth, Gender gender, String avatar, Contact? primaryContact, List< Contact> secondaryContacts, String email, List<String> languages, String currentOrganizationID, String currentProgramID, bool active, bool termsAccepted, bool hasSetPin, bool hasSetNickname, bool isPhoneVerified, bool pinChangeRequired, bool pinUpdateRequired, bool suspended, String streamToken)?) → TResult? -
Available on User, provided by the UserPatterns extension
A variant ofwhen
that fallback to returningnull
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited