CarpUser class

Represents a CARP user.

Annotations
  • @JsonSerializable(fieldRename: FieldRename.snake, includeIfNull: false)

Constructors

CarpUser({required String username, int? id, String? accountId, String? firstName, String? lastName, bool? isActivated = true, String? phone, String? email, String? department, String? organization})
CarpUser.fromJson(Map<String, dynamic> json)
factory

Properties

accountId String?
The CARP account id.
getter/setter pair
created DateTime?
Timestamp for the creation of this user.
getter/setter pair
department String?
Department of the the user (e.g. CACHET)
getter/setter pair
email String?
The user's email
getter/setter pair
firstName String?
User's first name
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id int?
Unique CARP ID
getter/setter pair
isActivated bool?
Is this user activated in any studies?
getter/setter pair
isAuthenticated bool
Returns true if the user is logged in; that is, has a valid token.
no setter
isEmailVerified bool
Returns true if the user's email is verified.
no setter
lastName String?
User's last name
getter/setter pair
organization String?
Organization of the the user (e.g. DTU)
getter/setter pair
phone String?
Mobile phone number
getter/setter pair
role List<String>
The list of roles that this user has in CARP.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
termsAgreed DateTime?
Timestamp for agreeing to the informed consent
getter/setter pair
token OAuthToken?
The OAuth 2.0 OAuthToken for this user, once authenticated to CARP. Is null if user is not authenticated.
getter/setter pair
username String
Unique CARP username
getter/setter pair

Methods

authenticated(OAuthToken token) → void
Set or update the authenticated OAuthToken token for this user.
getOAuthToken({bool refresh = false}) Future<OAuthToken?>
Obtains the OAuth token for the current user, forcing a refresh if desired.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reload() Future<void>
Reload the data of the current user (e.g., fullName, telephone, etc.) from the CARP web service.
signOut() Future<void>
Sign out the current user.
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

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