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(false) @JsonKey(name: 'ekenabled') @BoolConverterNullable() bool optionalTasksEnabled, @Default('') String email, @Default(-1) @JsonKey(name: 'capabilities') int capabilitiesBitMask, @Default('') @JsonKey(name: 'theme') String themeName, @Default('') @JsonKey(name: 'profileimageurl') String profileImageUrl, @Default(-1) @JsonKey(name: 'planid') int planId, @Default('') @JsonKey(name: 'colorblindness') String colorBlindnessString, @Default(false) @JsonKey(name: 'displaytaskcount') @BoolConverterNullable() bool displayTaskCount, Vintage? vintage})
A user using the application.
factory
User.fromJson(Map<String, dynamic> json)
Load a user from json
factory

Properties

capabilities → Set<UserCapability>
The capabilities the user has
no setter
capabilitiesBitMask → int
A bitmask of the capabilities the user has
no setterinherited
colorBlindness → ColorBlindnessType
The ColorBlindnessType of user based on colorBlindnessString.
no setter
colorBlindnessString → String
The color blindness of the user as a string
no setterinherited
copyWith → $UserCopyWith<User>
Create a copy of User with the given fields replaced by the non-null parameter values.
no setterinherited
displayTaskCount → bool
Whether to display the task count in the calendar view
no setterinherited
email → String
The email address of the user
no setterinherited
firstname → String
The firstname of the user
no setterinherited
fullname → String
Returns the full name of the user.
no setter
hashCode → int
The hash code for this object.
no setterinherited
id → int
The id of the user
no setterinherited
lastname → String
The lastname of the user
no setterinherited
optionalTasksEnabled → bool
true if MoodleTasks of type MoodleTaskType.optional are enabled.
no setterinherited
planId → int
The id of the plan the user is assigned to
no setterinherited
profileImageUrl → String
The url of the profile image
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
themeName → String
The name of the theme the user has selected
no setterinherited
username → String
The username of the user
no setterinherited
validOrNull → User?
Returns null if this user i not valid i.e. id is -1.
no setter
vintage → Vintage?
The vintage of the user
no setterinherited

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>
Serializes this User to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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