GroupChannel class
Represents a group channel.
- Inheritance
-
- Object
- BaseChannel
- GroupChannel
- Available Extensions
- BaseChannelMessage
- BaseChannelMessageMetaArray
- BaseChannelMetaCounters
- BaseChannelMetaData
- BaseChannelModeration
- BaseChannelOperator
- BaseChannelReactions
- GroupChannelConfiguration
- GroupChannelExtensions
- GroupChannelOperation
- GroupChannelPinnedMessage
- GroupChannelPoll
- GroupChannelRead
- GroupChannelScheduledMessage
- GroupChannelTyping
- Annotations
-
- @JsonSerializable()
Constructors
-
GroupChannel({required String channelUrl, BaseMessage? lastMessage, bool isSuper = false, bool isBroadcast = false, bool isPublic = false, bool isDistinct = false, bool isDiscoverable = false, bool isExclusive = false, bool isAccessCodeRequired = false, int unreadMessageCount = 0, int unreadMentionCount = 0, List<
Member> members = const [], int memberCount = 0, int joinedMemberCount = 0, GroupChannelPushTriggerOption myPushTriggerOption = GroupChannelPushTriggerOption.defaultValue, bool isChatNotification = false, MemberState myMemberState = MemberState.none, Role myRole = Role.none, MuteState myMutedState = MuteState.unmuted, CountPreference myCountPreference = CountPreference.all, User? creator, Member? inviter, int invitedAt = 0, int joinedAt = 0, bool isHidden = false, int myLastRead = 0, int? messageOffsetTimestamp, int messageSurvivalSeconds = -1, List<int> pinnedMessageIds = const [], BaseMessage? lastPinnedMessage, int pinnedMessageUpdatedAt = 0, String name = '', String coverUrl = '', int? createdAt, String data = '', String customType = '', bool isFrozen = false, bool isEphemeral = false}) -
GroupChannel.fromJson(Map<
String, dynamic> json) -
factory
-
GroupChannel.fromJsonWithChat(Chat chat, Map<
String, dynamic> json) -
factory
Properties
- channelType → ChannelType
-
ChannelType
no setterinherited
- channelUrl ↔ String
-
The unique channel URL.
getter/setter pairinherited
- chat ↔ Chat
-
getter/setter pairinherited
- coverUrl ↔ String
-
The cover image URL.
getter/setter pairinherited
- createdAt ↔ int?
-
The creation time of the channel.
getter/setter pairinherited
- creator ↔ User?
-
The creator of this channel.
getter/setter pair
- customType ↔ String
-
The custom type of the channel.
getter/setter pairinherited
- data ↔ String
-
The channel data.
getter/setter pairinherited
- dirty ↔ bool
-
getter/setter pairinherited
- fromCache ↔ bool
-
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setteroverride
-
The hiddenState of this channel.
getter/setter pair
- invitedAt ↔ int
-
My invitation timestamp.
getter/setter pair
- inviter ↔ Member?
-
The inviter of the current User to this channel.
getter/setter pair
- isAccessCodeRequired ↔ bool
-
Whether this channel requires access code to join.
This value is valid only if this channel is a public GroupChannel.
getter/setter pair
- isBroadcast ↔ bool
-
Checks whether this channel is a broadcast GroupChannel.
getter/setter pair
- isChatNotification ↔ bool
-
Checks whether this channel is a chat notification GroupChannel.
@since 4.0.3
getter/setter pair
- isDiscoverable ↔ bool
-
Checks whether this channel is discoverable in the result of PublicGroupChannelListQuery.
If it is false, it will not appear on the result of PublicGroupChannelListQuery.
getter/setter pair
- isDistinct ↔ bool
-
Checks whether this channel is a distinct GroupChannel.
For a distinct GroupChannel, later when you create GroupChannel with same User and isDistinct flag being
true
(refer to createChannel), the channel URL does not change, which means the messages between Users remain at the channel. If the channel is not distinct one, a new GroupChannel is created even though Users are same. As a result, you get a totally new channel URL (the old channel still remains), which means the Users start new conversation.getter/setter pair - isEphemeral ↔ bool
-
Whether the channel is ephemeral.
getter/setter pairinherited
- isExclusive ↔ bool
-
Checks whether this channel is an exclusive GroupChannel.
getter/setter pair
- isFrozen ↔ bool
-
Whether the channel is frozen.
getter/setter pairinherited
- isHidden ↔ bool
-
Checks whether this channel is hidden.
getter/setter pair
- isPublic ↔ bool
-
Checks whether this channel is a public GroupChannel.
getter/setter pair
- isSuper ↔ bool
-
Checks whether this channel is a super GroupChannel.
getter/setter pair
- joinedAt ↔ int
-
The timestamp when the current user joined.
getter/setter pair
- joinedMemberCount ↔ int
-
The total joined member count for this channel.
getter/setter pair
- key → String
-
no setterinherited
- lastMessage ↔ BaseMessage?
-
The last message of the channel.
getter/setter pair
- lastPinnedMessage ↔ BaseMessage?
-
The last message among channel's pinned messages.
getter/setter pair
- memberCount ↔ int
-
The total member count for this channel.
getter/setter pair
-
members
↔ List<
Member> -
Member list for this channel.
getter/setter pair
- messageOffsetTimestamp ↔ int?
-
This property is set when GroupChannelOperation.resetMyHistory and GroupChannelConfiguration.hide is called.
getter/setter pair
- messageSurvivalSeconds ↔ int
-
getter/setter pair
- myCountPreference ↔ CountPreference
-
Checks whether unread message count is enabled for this channel.
This count preference can be set by GroupChannelConfiguration.setMyCountPreference.
getter/setter pair
- myLastRead ↔ int
-
Current user's last read receipt timestamp in channel.
getter/setter pair
- myMemberState ↔ MemberState
-
My member state.
getter/setter pair
- myMutedState ↔ MuteState
-
My muted state in this channel.
getter/setter pair
- myPushTriggerOption ↔ GroupChannelPushTriggerOption
-
My push trigger option.
The push trigger setting can be updated by GroupChannelConfiguration.setMyPushTriggerOption.
getter/setter pair
- myRole ↔ Role
-
My Role in this channel.
getter/setter pair
- name ↔ String
-
The topic or name of the channel.
getter/setter pairinherited
-
pinnedMessageIds
↔ List<
int> -
The pinned message ids of the channel.
getter/setter pair
- pinnedMessageUpdatedAt ↔ int
-
getter/setter pair
- primaryKey → String
-
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- unreadMentionCount ↔ int
-
The unread mention count for this channel for the current User.
getter/setter pair
- unreadMessageCount ↔ int
-
The unread message count for this channel for the current User.
getter/setter pair
Methods
-
checkUnsupportedAction(
) → void -
inherited
-
copyWith(
dynamic other) → void -
override
-
deleteChannel(
) → Future< void> -
Deletes this
GroupChannel
. Note that only operators of a channel are able to delete it or else, an error will be returned to the handler. -
getCachedDeliveryStatus(
String channelUrl) → Map< String, int> -
getCachedReadStatus(
String channelUrl) → Map< String, int> -
getMember(
String userId) → Member? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
serialize(
) → Uint8List -
inherited
-
set(
Chat chat) → void -
inherited
-
setCachedDeliveryStatus(
Map< String, int> deliveryStatus) → void -
setCachedReadStatus(
Map< String, int> readStatus) → void -
toJson(
) → Map< String, dynamic> -
override
-
toString(
) → String -
A string representation of this object.
inherited
-
updateChannel(
GroupChannelUpdateParams params, {ProgressHandler? progressHandler}) → Future< GroupChannel> - Update this channel with GroupChannelUpdateParams.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
createChannel(
GroupChannelCreateParams params, {ProgressHandler? progressHandler, Chat? chat}) → Future< GroupChannel> -
Creates
GroupChannel
with GroupChannelCreateParams. -
getChannel(
String channelUrl, {Chat? chat}) → Future< GroupChannel> -
Gets a
GroupChannel
with given channel URL. -
getChannelFromCache(
String channelUrl, {Chat? chat}) → Future< GroupChannel?> -
Gets a
GroupChannel
with given channel URL from cache. -
refresh(
String channelUrl, {Chat? chat}) → Future< GroupChannel> - Refreshes all the data of this channel.