GroupChannel constructor Null safety

GroupChannel(
  1. {BaseMessage? lastMessage,
  2. bool isSuper = false,
  3. bool isStrict = false,
  4. bool isBroadcast = false,
  5. bool isPublic = false,
  6. bool isDistinct = false,
  7. bool isDiscoverable = false,
  8. bool isExclusive = false,
  9. bool accessCodeRequired = false,
  10. int unreadMessageCount = 0,
  11. int unreadMentionCount = 0,
  12. List<Member> members = const [],
  13. int memberCount = 0,
  14. int joinedMemberCount = 0,
  15. int joinedAt = 0,
  16. GroupChannelPushTriggerOption myPushTriggerOption = GroupChannelPushTriggerOption.all,
  17. MemberState myMemberState = MemberState.none,
  18. Role myRole = Role.none,
  19. MuteState myMutedState = MuteState.unmuted,
  20. CountPreference myCountPreference = CountPreference.all,
  21. int invitedAt = 0,
  22. Member? inviter,
  23. bool isHidden = false,
  24. GroupChannelHiddenState hiddenState = GroupChannelHiddenState.unhidden,
  25. int myLastRead = 0,
  26. int? messageOffsetTimestamp,
  27. int messageSurvivalSeconds = -1,
  28. required String channelUrl,
  29. String? name,
  30. String? coverUrl,
  31. User? creator,
  32. int? createdAt,
  33. String? data,
  34. String? customType,
  35. bool isFrozen = false,
  36. bool isEphemeral = false,
  37. BaseMessage? lastPinnedMessage,
  38. int pinnedMessagesUpdatedAt = 0}
)

WARNING: Do not use default constructor to initialize manually

Implementation

GroupChannel({
  this.lastMessage,
  this.isSuper = false,
  this.isStrict = false,
  this.isBroadcast = false,
  this.isPublic = false,
  this.isDistinct = false,
  this.isDiscoverable = false,
  this.isExclusive = false,
  this.accessCodeRequired = false,
  this.unreadMessageCount = 0,
  this.unreadMentionCount = 0,
  this.members = const [],
  this.memberCount = 0,
  this.joinedMemberCount = 0,
  this.joinedAt = 0,
  this.myPushTriggerOption = GroupChannelPushTriggerOption.all,
  this.myMemberState = MemberState.none,
  this.myRole = Role.none,
  this.myMutedState = MuteState.unmuted,
  this.myCountPreference = CountPreference.all,
  this.invitedAt = 0,
  this.inviter,
  this.isHidden = false,
  this.hiddenState = GroupChannelHiddenState.unhidden,
  this.myLastRead = 0,
  this.messageOffsetTimestamp,
  this.messageSurvivalSeconds = -1,
  required String channelUrl,
  String? name,
  String? coverUrl,
  User? creator,
  int? createdAt,
  String? data,
  String? customType,
  bool isFrozen = false,
  bool isEphemeral = false,
  this.lastPinnedMessage,
  this.pinnedMessagesUpdatedAt = 0,
}) : super(
        channelUrl: channelUrl,
        name: name,
        coverUrl: coverUrl,
        creator: creator,
        createdAt: createdAt,
        data: data,
        customType: customType,
        isFrozen: isFrozen,
        isEphemeral: isEphemeral,
        fromCache: false,
        dirty: false,
      ) {
  //If exclusive [isSuper] and [isBroadcast] are true
  if (isExclusive == true) {
    isSuper = true;
    isBroadcast = true;
  }
}