UserProfile class Activity Store
A user's profile, kept locally and synced like the activities, one per user.
The avatar has two sides: avatarUrl is the picture on the server and avatarLocalPath the cached copy used for offline display. To change the avatar, set avatarLocalPath to the new image and avatarDirty to true; the store uploads it and keeps it as the cached copy.
See also:
- ActivityStore.upsertUserProfile - Save a profile locally and queue it for sync.
- ActivityStore.getUserProfile - Read the locally stored profile.
- Annotations
Constructors
- UserProfile({String userID = '', String firstName = '', String lastName = '', String dateOfBirth = '', int genderId = 0, String bio = '', double weight = 0.0, String location = '', String avatarUrl = '', String avatarLocalPath = '', bool avatarDirty = false, int updatedAtMillis = 0})
- Creates a UserProfile.
Properties
- avatarDirty ↔ bool
-
Whether the local avatar is newer than the server one and has to be uploaded.
getter/setter pair
- avatarLocalPath ↔ String
-
The cached avatar image file; empty when not cached.
getter/setter pair
- avatarUrl ↔ String
-
The URL of the avatar on the server; empty when none.
getter/setter pair
- bio ↔ String
-
The biography.
getter/setter pair
- dateOfBirth ↔ String
-
The date of birth as
yyyy-MM-dd; empty when unset.getter/setter pair - firstName ↔ String
-
The first name.
getter/setter pair
- genderId ↔ int
-
The gender: 0 unknown, 1 male, 2 female, 3 other.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- lastName ↔ String
-
The last name.
getter/setter pair
- location ↔ String
-
The user's location.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- updatedAtMillis ↔ int
-
The last update time in milliseconds since epoch (UTC); the newer copy wins when syncing.
getter/setter pair
- userID ↔ String
-
The backend user id; the key of the profile.
getter/setter pair
- weight ↔ double
-
The body weight.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited