ChannelModel class

The class that contains the information about a channel

Implementers
Annotations
  • @JsonSerializable()

Constructors

ChannelModel({String? id, String? type, String? cid, ChannelConfig? config, User? createdBy, bool frozen = false, DateTime? lastMessageAt, DateTime? createdAt, DateTime? updatedAt, DateTime? deletedAt, int memberCount = 0, Map<String, Object?> extraData = const {}, String? team, int cooldown = 0})
Constructor used for json serialization
ChannelModel.fromJson(Map<String, dynamic> json)
Create a new instance from a json
factory

Properties

cid String
The cid of this channel
final
config ChannelConfig
The channel configuration data
final
cooldown int
The number of seconds in a cooldown
final
createdAt DateTime
The date of channel creation
final
createdBy User?
The user that created this channel
final
deletedAt DateTime?
The date of channel deletion
final
extraData Map<String, Object?>
Map of custom channel extraData
final
frozen bool
True if this channel is frozen
final
hashCode int
The hash code for this object.
no setterinherited
id String
The id of this channel
final
lastMessageAt DateTime?
The date of the last message
final
memberCount int
The count of this channel members
final
name String
Shortcut for channel name
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
team String?
The team the channel belongs to
final
type String
The type of this channel
final
updatedAt DateTime
The date of the last channel update
final

Methods

copyWith({String? id, String? type, String? cid, ChannelConfig? config, User? createdBy, bool? frozen, DateTime? lastMessageAt, DateTime? createdAt, DateTime? updatedAt, DateTime? deletedAt, int? memberCount, Map<String, Object?>? extraData, String? team, int? cooldown}) ChannelModel
Creates a copy of ChannelModel with specified attributes overridden.
merge(ChannelModel? other) ChannelModel
Returns a new ChannelModel that is a combination of this channelModel and the given other channelModel.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serialize to json
toString() String
A string representation of this object.
inherited

Operators

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

Constants

topLevelFields → const List<String>
Known top level fields. Useful for Serializer methods.