ChannelModel class
The class that contains the information about a channel
- Annotations
-
- @JsonSerializable()
Constructors
-
ChannelModel({String? id, String? type, String? cid, List<
String> ? ownCapabilities, 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, bool? disabled, DateTime? truncatedAt}) - 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
- disabled → bool?
-
True if the channel is disabled
no setter
-
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
-
True if the channel is hidden
no setter
- 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
-
ownCapabilities
→ List<
String> ? -
List of user permissions on this channel
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- team → String?
-
The team the channel belongs to
final
- truncatedAt → DateTime?
-
The date of the last time channel got truncated
no setter
- 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, List< String> ? ownCapabilities, ChannelConfig? config, User? createdBy, bool? frozen, DateTime? lastMessageAt, DateTime? createdAt, DateTime? updatedAt, DateTime? deletedAt, int? memberCount, Map<String, Object?> ? extraData, String? team, int? cooldown, bool? disabled, DateTime? truncatedAt}) → 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.