OwnUser class Null safety

The class that defines the own user model.

This object can be found in Event.

Inheritance
Annotations

Constructors

OwnUser({List<Device> devices = const [], List<Mute> mutes = const [], int totalUnreadCount = 0, int unreadChannels = 0, List<Mute> channelMutes = const [], required String id, String? role, String? name, String? image, DateTime? createdAt, DateTime? updatedAt, DateTime? lastActive, bool online = false, Map<String, Object?> extraData = const {}, bool banned = false, List<String> teams = const [], String? language})
Constructor used for json serialization.
OwnUser.fromJson(Map<String, dynamic> json)
Create a new instance from json.
factory
OwnUser.fromUser(User user)
Create a new instance from User object.
factory

Properties

banned bool
True if user is banned from the chat.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final, inherited
channelMutes List<Mute>
List of users muted by the user.
@JsonKey(includeIfNull: false), final
createdAt DateTime
Date of user creation.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final, inherited
devices List<Device>
List of user devices.
@JsonKey(includeIfNull: false), final
extraData Map<String, Object?>
Map of custom user extraData.
@JsonKey(includeIfNull: false), final, inherited
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
User id.
final, inherited
image String?
Shortcut for user image. [...]
@JsonKey(ignore: true), read-only, inherited
language String?
The language this user prefers.
@JsonKey(includeIfNull: false), final, inherited
lastActive DateTime?
Date of last user connection.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final, inherited
mutes List<Mute>
List of users muted by the user.
@JsonKey(includeIfNull: false), final
name String
Shortcut for user name. [...]
@JsonKey(ignore: true), read-only, inherited
online bool
True if user is online.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final, inherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
read-only, inherited
role String?
User role.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props. [...]
read-only, inherited
teams List<String>
User teams
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final, inherited
totalUnreadCount int
Total unread messages by the user.
@JsonKey(includeIfNull: false), final
unreadChannels int
Total unread channels by the user.
@JsonKey(includeIfNull: false), final
updatedAt DateTime
Date of last user update.
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final, inherited

Methods

copyWith({String? id, String? role, String? name, String? image, DateTime? createdAt, DateTime? updatedAt, DateTime? lastActive, bool? online, Map<String, Object?>? extraData, bool? banned, List<String>? teams, List<Mute>? channelMutes, List<Device>? devices, List<Mute>? mutes, int? totalUnreadCount, int? unreadChannels, String? language}) OwnUser
Creates a copy of OwnUser with specified attributes overridden.
override
merge(OwnUser? other) OwnUser
Returns a new OwnUser that is a combination of this ownUser and the given other ownUser.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toJson() Map<String, dynamic>
Serialize to json.
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

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

Static Properties

topLevelFields List<String>
Known top level fields. [...]
final