The Chat SDK simplifies chat features into an effortless and straightforward process. To send your first message, do the following steps:
To allow the Chat SDK to respond to the connection and state changes in your Flutter client app, you first initialize the Chat SDK in the app. Pass in the App ID of the Sendbird application you created earlier in the Sendbird Dashboard for the initialization.
Note: The constructor of a
SendbirdSdkinstance must be called once across your Flutter client app. We recommend that you initialize the Chat SDK in the
main.dartand use its variable across your application.
Connect a user to Sendbird server using their unique user ID. Any untaken user ID is automatically registered as a new user to your Sendbird application before being connected, while an existing ID is allowed to log in directly.
Note: Go to the Authentication page to learn more about authenticating with an access token.
Create an open channel. Once created, all users in your Sendbird application can easily participate in the channel.
Note: In a similar fashion, you can create a group channel by inviting users as new members to the channel.
Enter the channel to send and receive messages.
Finally, send a message to the channel. There are three types: a user message is a plain text, a file message is a binary file, such as an image or PDF, and an admin message is a plain text sent through the Sendbird Dashboard or Platform API.