ChannelModel class Null safety

The class that contains the information about a channel

Implementers
Annotations

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
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
config ChannelConfig
The channel configuration data
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
cooldown int
The number of seconds in a cooldown
@JsonKey(includeIfNull: false), final
createdAt DateTime
The date of channel creation
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
createdBy User?
The user that created this channel
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
deletedAt DateTime?
The date of channel deletion
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
extraData Map<String, Object?>
Map of custom channel extraData
@JsonKey(includeIfNull: false), final
frozen bool
True if this channel is frozen
@JsonKey(includeIfNull: false), final
hashCode int
The hash code for this object. [...]
read-only, inherited
id String
The id of this channel
final
lastMessageAt DateTime?
The date of the last message
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
memberCount int
The count of this channel members
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
name String
Shortcut for channel name
read-only
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
team String?
The team the channel belongs to
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), final
type String
The type of this channel
final
updatedAt DateTime
The date of the last channel update
@JsonKey(includeIfNull: false, toJson: Serializer.readOnly), 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 non-existent 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.
['id', 'type', 'cid', 'config', 'created_by', 'frozen', 'last_message_at', 'created_at', 'updated_at', 'deleted_at', …