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('') String email, @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, Vintage? 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
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 or not.
no setter
- displayTaskCountInt → int
-
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
- isElevated → bool
-
Returns
true
if this user has elevated privileges (i.e. UserCapability.dev or UserCapability.moderator). Otherwisefalse
.no setter - language → String
-
The language the user has selected
no setterinherited
- lastname → String
-
The lastname of the user
no setterinherited
- locale → Locale
-
The Locale to use based on the user's
language
.no setter - 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 givencapability
. Otherwisefalse
. -
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