User constructor

User({
  1. @JsonKey(name: 'userid') required int id,
  2. required String username,
  3. required String firstname,
  4. required String lastname,
  5. @Default('') String email,
  6. @Default(-1) @JsonKey(name: 'capabilities') int capabilitiesBitMask,
  7. @Default('') @JsonKey(name: 'theme') String themeName,
  8. @Default('') @JsonKey(name: 'lang') String language,
  9. @Default('') @JsonKey(name: 'profileimageurl') String profileImageUrl,
  10. @Default(-1) @JsonKey(name: 'planid') int planId,
  11. @Default('') @JsonKey(name: 'colorblindness') String colorBlindnessString,
  12. @Default(1) @JsonKey(name: 'displaytaskcount') int displayTaskCountInt,
  13. Vintage? vintage,
})

A user using the application.

Implementation

factory User({
  /// The id of the user
  @JsonKey(name: 'userid') required int id,

  /// The username of the user
  required String username,

  /// The firstname of the user
  required String firstname,

  /// The lastname of the user
  required String lastname,

  /// The email address of the user
  @Default('') String email,

  /// A bitmask of the capabilities the user has
  @Default(-1) @JsonKey(name: 'capabilities') int capabilitiesBitMask,

  /// The name of the theme the user has selected
  @Default('') @JsonKey(name: 'theme') String themeName,

  /// The language the user has selected
  @Default('') @JsonKey(name: 'lang') String language,

  /// The url of the profile image
  @Default('') @JsonKey(name: 'profileimageurl') String profileImageUrl,

  /// The id of the plan the user is assigned to
  @Default(-1) @JsonKey(name: 'planid') int planId,

  /// The color blindness of the user as a string
  @Default('') @JsonKey(name: 'colorblindness') String colorBlindnessString,

  /// Whether to display the task count in the calendar view
  @Default(1) @JsonKey(name: 'displaytaskcount') int displayTaskCountInt,

  /// The vintage of the user
  Vintage? vintage,
}) = _User;