Chat UIKit Flutter v3
Chat UIKit Flutter
Chat UIKit
Flutter
Version 3

Chat in a group channel

Copy link

A group channel is a chat that allows close interactions between a limited number of users. In order to join this type of channel, an invitation from a channel member is required by default. Users can create 1-to-1 group channels or 1-to-N group channels and there's also a supergroup channel, which is an expanded version of a group channel that can accommodate more than 2,000 members in one channel.


Group channel screen

Copy link


The channelUrl parameter in SBUGroupChannelScreen constructor is required and the others are optional.

Widget screen = SBUGroupChannelScreen(
  channelUrl: 'CHANNEL_URL', // Required parameter
  params: MessageListParams(), // Params for MessageCollection
  onMessageCollectionReady: (collectionNo) {
    final collection = SendbirdUIKit.getMessageCollection(collectionNo);
    // You can use the collection for this screen.
  },
  onScrollControllerReady: (scrollController) {
    // You can use the scrollController for this screen.
  },
  onChannelDeleted: (channel) {
    // Move to SBUGroupChannelListScreen.
  },
  onInfoButtonClicked: (collectionNo) {
    // Move to SBUGroupChannelInformationScreen.
  },
  on1On1ChannelCreated: (channel) {
    // Move to SBUGroupChannelScreen.
  },
);

Customization

Copy link
Widget screen = SBUGroupChannelScreen(
  channelUrl: 'CHANNEL_URL', // Required parameter
  customHeader: (context, theme, strings, collection) {
    // context: BuildContext
    // theme: SBUTheme
    // strings: SBUStrings
    // collection: MessageCollection
    return Container(); // Return your custom header widget.
  },
  customListItem: (context, theme, strings, collection, index, message) {
    // index: int
    // message: BaseMessage
    return Container(); // Return your custom list item widget.
  },
  customMessageInput: (context, theme, strings, collection) {
    return Container(); // Return your custom message input widget.
  },
  customLoadingBody: (context, theme, strings, collection) {
    return Container(); // Return your custom loading body widget.
  },
  customEmptyBody: (context, theme, strings, collection) {
    return Container(); // Return your custom empty body widget.
  },
  customErrorScreen: (context, theme, strings) {
    return Container(); // Return your custom error screen widget.
  },
  customFrozenChannel: (context, theme, strings, collection) {
    return Container(); // Return your custom frozen channel widget.
  },
);