User class

A user using the application.

Annotations

Constructors

User({@JsonKey(name: 'userid') required int id, required String username, required String firstname, required String lastname, @Default(-1) @JsonKey(name: 'capabilities') int capabilitiesBitMask, @Default("") @JsonKey(name: "theme") String themeName, @Default("") @JsonKey(name: 'lang') String language, @Default("") @JsonKey(name: 'profileimageurl') String profileImageUrl, @Default(-1) @JsonKey(name: 'planid') int planId, @Default("") @JsonKey(name: 'colorblindness') String colorBlindnessString, @Default(1) @JsonKey(name: 'displaytaskcount') int displayTaskCountInt, @Default("") String vintage})
A user using the application.
factory
User.fromJson(Map<String, dynamic> json)
Load a user from json
factory

Properties

capabilities → List<UserCapability>
The capabilities the user has
read-only
capabilitiesBitMask → int
A bitmask of the capabilities the user has
read-onlyinherited
colorBlindness → ColorBlindnessType
The ColorBlindnessType of user based on colorBlindnessString.
read-only
colorBlindnessString → String
The color blindness of the user as a string
read-onlyinherited
copyWith → $UserCopyWith<User>
read-onlyinherited
displayTaskCount → bool
Whether to display the task count in the calendar view or not.
read-only
displayTaskCountInt → int
Whether to display the task count in the calendar view
read-onlyinherited
firstname → String
The firstname of the user
read-onlyinherited
hashCode → int
The hash code for this object.
read-onlyinherited
id → int
The id of the user
read-onlyinherited
isElevated → bool
Returns true if this user has elevated privileges (i.e. UserCapability.dev or UserCapability.moderator). Otherwise false.
read-only
language → String
The language the user has selected
read-onlyinherited
lastname → String
The lastname of the user
read-onlyinherited
locale → Locale
The Locale to use based on the user's language.
read-only
planId → int
The id of the plan the user is assigned to
read-onlyinherited
profileImageUrl → String
The url of the profile image
read-onlyinherited
runtimeType → Type
A representation of the runtime type of the object.
read-onlyinherited
themeName → String
The name of the theme the user has selected
read-onlyinherited
username → String
The username of the user
read-onlyinherited
validOrNull → User?
Returns null if this user i not valid i.e. id is -1.
read-only
vintage → String
The vintage of the user
read-onlyinherited

Methods

hasCapability(UserCapability capability) → bool
Returns true if the user has the given capability. Otherwise false.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
inherited
toString() → String
A string representation of this object.
inherited

Operators

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