Employee class abstract

Available extensions
Annotations
  • @freezed

Constructors

Employee({required String id, required String name, String? email, String? username, Department? department, String? departmentId, Avatar? dynamicAvatar, Token? token, GenericPermission? permissions, GenericPermission? customPermissions, @Default.new(false) bool mfaEnabled, @MfaMethodConverter() @Default.new([]) List<MfaMethod> mfaMethods, UserPreferences? preferences})
Employee represents the user model.
const
factory
Employee.fromJson(Map<String, dynamic> json)
factory

Properties

copyWith → $EmployeeCopyWith<Employee>
Create a copy of Employee with the given fields replaced by the non-null parameter values.
no setterinherited
customPermissions GenericPermission?
customPermissions represents the user custom permissions.
no setterinherited
department Department?
department represents the user department.
no setterinherited
departmentId String?
departmentId represents the user department id.
no setterinherited
dynamicAvatar Avatar?
dynamicAvatar represents the user avatar.
no setterinherited
email String?
email represents the user email.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
id String
id represents the user id.
no setterinherited
mfaEnabled bool
mfaEnabled represents the MFA enabled flag.
no setterinherited
mfaMethods List<MfaMethod>
mfaMethods represents the list of MFA methods.
no setterinherited
name String
name represents the user name.
no setterinherited
permissions GenericPermission?
permissions represents the user permissions.
no setterinherited
preferences UserPreferences?
preferences represents the user preferences.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
token Token?
token represents the user token.
no setterinherited
username String?
username represents the user username.
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_Employee value)) → TResult

Available on Employee, provided by the EmployeePatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_Employee value)?) → TResult?

Available on Employee, provided by the EmployeePatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_Employee value)?, {required TResult orElse()}) → TResult

Available on Employee, provided by the EmployeePatterns extension

A variant of map that fallback to returning orElse.
maybeWhen<TResult extends Object?>(TResult $default(String id, String name, String? email, String? username, Department? department, String? departmentId, Avatar? dynamicAvatar, Token? token, GenericPermission? permissions, GenericPermission? customPermissions, bool mfaEnabled, List<MfaMethod> mfaMethods, UserPreferences? preferences)?, {required TResult orElse()}) → TResult

Available on Employee, provided by the EmployeePatterns extension

A variant of when that fallback to an orElse callback.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes this Employee to a JSON map.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>(TResult $default(String id, String name, String? email, String? username, Department? department, String? departmentId, Avatar? dynamicAvatar, Token? token, GenericPermission? permissions, GenericPermission? customPermissions, bool mfaEnabled, List<MfaMethod> mfaMethods, UserPreferences? preferences)) → TResult

Available on Employee, provided by the EmployeePatterns extension

A switch-like method, using callbacks.
whenOrNull<TResult extends Object?>(TResult? $default(String id, String name, String? email, String? username, Department? department, String? departmentId, Avatar? dynamicAvatar, Token? token, GenericPermission? permissions, GenericPermission? customPermissions, bool mfaEnabled, List<MfaMethod> mfaMethods, UserPreferences? preferences)?) → TResult?

Available on Employee, provided by the EmployeePatterns extension

A variant of when that fallback to returning null

Operators

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