OwnUser class

The class that defines the own user model.

This object can be found in Event.

Inheritance
Annotations
  • @JsonSerializable(createToJson: false)

Constructors

OwnUser({List<Device> devices = const [], List<Mute> mutes = const [], int totalUnreadCount = 0, int unreadChannels = 0, List<ChannelMute> 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, DateTime? banExpires, 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

banExpires DateTime?
The date at which the ban will expire.
finalinherited
banned bool
True if user is banned from the chat.
finalinherited
channelMutes List<ChannelMute>
List of channels muted by the user.
final
createdAt DateTime
Date of user creation.
finalinherited
devices List<Device>
List of user devices.
final
extraData Map<String, Object?>
Map of custom user extraData.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
id String
User id.
finalinherited
image String?
Shortcut for user image.
no setterinherited
language String?
The language this user prefers.
finalinherited
lastActive DateTime?
Date of last user connection.
finalinherited
mutes List<Mute>
List of users muted by the user.
final
name String
Shortcut for user name.
no setterinherited
online bool
True if user is online.
finalinherited
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setterinherited
role String?
User role.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
teams List<String>
User teams
finalinherited
totalUnreadCount int
Total unread messages by the user.
final
unreadChannels int
Total unread channels by the user.
final
updatedAt DateTime
Date of last user update.
finalinherited

Methods

copyWith({String? id, String? role, String? name, String? image, DateTime? createdAt, DateTime? updatedAt, DateTime? lastActive, bool? online, Map<String, Object?>? extraData, bool? banned, DateTime? banExpires, List<String>? teams, List<ChannelMute>? 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 nonexistent 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