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(createToJson: false)
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
read-onlyinherited
- channelUrl ↔ String
-
The unique channel URL.
read / writeinherited
- chat ↔ Chat
-
read / writeinherited
- coverUrl ↔ String
-
The cover image URL.
read / writeinherited
- createdAt ↔ int?
-
The creation time of the channel.
read / writeinherited
- creator ↔ User?
-
The creator of this channel.
read / write
- customType ↔ String
-
The custom type of the channel.
read / writeinherited
- data → String
-
The channel data.
read-onlyinherited
- dirty ↔ bool
-
read / writeinherited
- fromCache ↔ bool
-
read / writeinherited
- hashCode → int
-
The hash code for this object.
read-onlyoverride
-
The hiddenState of this channel.
read / write
- invitedAt ↔ int
-
My invitation timestamp.
read / write
- inviter ↔ Member?
-
The inviter of the current User to this channel.
read / write
- isAccessCodeRequired ↔ bool
-
Whether this channel requires access code to join.
This value is valid only if this channel is a public GroupChannel.
read / write
- isBroadcast ↔ bool
-
Checks whether this channel is a broadcast GroupChannel.
read / write
- isChatNotification ↔ bool
-
Checks whether this channel is a chat notification GroupChannel.
@since 4.0.1
read / write
- 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.
read / write
- 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.read / write - isEphemeral → bool
-
Whether the channel is ephemeral.
read-onlyinherited
- isExclusive ↔ bool
-
Checks whether this channel is an exclusive GroupChannel.
read / write
- isFrozen ↔ bool
-
Whether the channel is frozen.
read / writeinherited
- isHidden ↔ bool
-
Checks whether this channel is hidden.
read / write
- isPublic ↔ bool
-
Checks whether this channel is a public GroupChannel.
read / write
- isSuper ↔ bool
-
Checks whether this channel is a super GroupChannel.
read / write
- joinedAt ↔ int
-
The timestamp when the current user joined.
read / write
- joinedMemberCount ↔ int
-
The total joined member count for this channel.
read / write
- key → String
-
read-onlyinherited
- lastMessage ↔ BaseMessage?
-
The last message of the channel.
read / write
- lastPinnedMessage ↔ BaseMessage?
-
The last message among channel's pinned messages.
read / write
- memberCount ↔ int
-
The total member count for this channel.
read / write
-
members
↔ List<
Member> -
Member list for this channel.
read / write
- messageOffsetTimestamp ↔ int?
-
This property is set when
GroupChannelOperation.resetMyHistory
andGroupChannelConfiguration.hide
is called.read / write - messageSurvivalSeconds ↔ int
-
The message survival seconds in this channel.
read / write
- myCountPreference ↔ CountPreference
-
Checks whether unread message count is enabled for this channel.
This count preference can be set by
GroupChannelConfiguration.setMyCountPreference
.read / write - myLastRead ↔ int
-
Current user's last read receipt timestamp in channel.
read / write
- myMemberState ↔ MemberState
-
My member state.
read / write
- myMutedState ↔ MuteState
-
My muted state in this channel.
read / write
- myPushTriggerOption ↔ GroupChannelPushTriggerOption
-
My push trigger option.
The push trigger setting can be updated by
GroupChannelConfiguration.setMyPushTriggerOption
.read / write - myRole ↔ Role
-
My Role in this channel.
read / write
- name ↔ String
-
The topic or name of the channel.
read / writeinherited
-
pinnedMessageIds
↔ List<
int> -
The pinned message ids of the channel.
read / write
- pinnedMessageUpdatedAt ↔ int
-
read / write
- primaryKey → String
-
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
- unreadMentionCount ↔ int
-
The unread mention count for this channel for the current User.
read / write
- unreadMessageCount ↔ int
-
The unread message count for this channel for the current User.
read / write
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. -
getMember(
String userId) → Member? -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
set(
Chat chat) → void -
inherited
-
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}) → GroupChannel? -
refresh(
String channelUrl, {Chat? chat}) → Future< GroupChannel> - Refreshes all the data of this channel.