Migration guide
Sendbird Chat SDK v4 for Flutter has introduced enhancements and revisions from v3, including major breaking changes to streamline the code structure and enhance its scalability.
This page explains the breaking changes and provides a step-by-step guide to assist in transitioning from v3 to v4.
Requirements
The minimum requirements for v4 are the following.
- Flutter 3.7.0 or later
- Dart 2.19.0 or later
Breaking changes
The following breaking changes have been made to the Chat SDK v4 for Flutter.
-
Renamed the core SDK class from
SendbirdSdktoSendbirdChat. -
Renamed
OptionstoSendbirdChatOptions. -
Renamed
loadNexttonext. -
Refactored the following params classes.
| From v3 | To v4 |
|---|---|
|
|
|
|
|
|
|
|
- Renamed the following params classes.
| From v3 | To v4 |
|---|---|
|
|
|
|
- Removed
Eventsuffix from handler class names as shown below.
| From v3 | To v4 |
|---|---|
|
|
|
|
|
|
- Added the following exception classes in v4.
| v4 |
|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- Added the following new collection classes in v4.
| v4 |
|---|
|
|
|
|
|
|
- Renamed the following enums.
| From v3 | To v4 |
|---|---|
|
|
|
|
|
|
- Removed the following enums from v3.
| v3 |
|---|
|
|
|
|
|
|
|
|
|
- Added the following enums in v4.
| v4 |
|---|
|
|
|
|
|
|
Migrating to v4
The following guide covers the changes and key steps required during the migration from the Chat SDK v3 to v4.
Sendbird Chat SDK v4 will likely prevent your app from compiling until all migration tasks are complete and all errors are fixed. After fixing all the blocking errors, further work may be needed to remove warnings and align the SDK with your app again. We recommend you allow a generous timeline for the task.
Step 1 Update import statements
Update all of import 'package:sendbird_sdk/sendbird_sdk.dart'; to import 'package:sendbird_chat_sdk/sendbird_chat_sdk.dart';.
Step 2 Refactor SendbirdSdk to SendbirdChat
Replace all of SendbirdSdk with SendbirdChat.
Step 3 Refactor Options to SendbirdChatOptions
Change Options to SendbirdChatOptions.
Step 4 Rename param classes
Adjust all param classes according to the mapping table.
Step 5 Rename handler classes
Update all handler class names by removing the 'Event' suffix. You can find the full list in number 6 of breaking changes.
Step 6 Update query retrieval functions
Switch all of loadNext to next.
Step 7 Update enum values
Update enum values that were renamed, removed, or added as listed in numbers 9, 10, and 11 of breaking changes.
Step 8 Update variable and method names
Update the variable and method names as shown in the table below. Changes are organized by v4 class names.
BaseChannel
| From v3 | To v4 |
|---|---|
- |
GroupChannel
| From v3 | To v4 |
|---|---|
- | |
- |
BaseMessage
| From v3 | To v4 |
|---|---|
- | |
- | |
- | |
- |
GroupChannelHandler
| From v3 | To v4 |
|---|---|
GroupChannelChangeLogs
DoNotDisturb
| From v3 | To v4 |
|---|---|
|
AppInfo
| From v3 | To v4 |
|---|---|
- |
FileInfo
MessageChangeLogs
GroupChannelChangeLogsParams
| From v3 | To v4 |
|---|---|
- | |
- |
GroupChannelTotalUnreadChannelCountParams
| From v3 | To v4 |
|---|---|
GroupChannelTotalUnreadMessageCountParams
| From v3 | To v4 |
|---|---|
BaseMessageCreateParams
BaseMessageFetchParams
| From v3 | To v4 |
|---|---|
- | |
- |
FileMessageCreateParams
MessageListParams
| From v3 | To v4 |
|---|---|
- |
MessageRetrievalParams
| From v3 | To v4 |
|---|---|
- |
ScheduledFileMessageCreateParams
| From v3 | To v4 |
|---|---|
- | |
- | |
- | |
- | |
- | |
- | |
- |
ScheduledUserMessageCreateParams
| From v3 | To v4 |
|---|---|
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- |
ThreadedMessageListParams
| From v3 | To v4 |
|---|---|
TotalScheduledMessageCountParams
UserMessageCreateParams
| From v3 | To v4 |
|---|---|
- | |
GroupChannelListQuery
| From v3 | To v4 |
|---|---|
- | |
- |
OpenChannelListQuery
| From v3 | To v4 |
|---|---|
PublicGroupChannelListQuery
| From v3 | To v4 |
|---|---|
- |
PreviousMessageListQuery
| From v3 | To v4 |
|---|---|
- | |
- | |
- | |
| - |
- | |
|
ScheduledMessageListQuery
| From v3 | To v4 |
|---|---|
PollListQuery
| From v3 | To v4 |
|---|---|
PollVoterListQuery
| From v3 | To v4 |
|---|---|
ApplicationUserListQuery
| From v3 | To v4 |
|---|---|
BannedUserListQuery
| From v3 | To v4 |
|---|---|
BlockedUserListQuery
| From v3 | To v4 |
|---|---|
MemberListQuery
| From v3 | To v4 |
|---|---|
MutedUserListQuery
| From v3 | To v4 |
|---|---|
OperatorListQuery
| From v3 | To v4 |
|---|---|
ParticipantListQuery
| From v3 | To v4 |
|---|---|
BaseQuery
Step 9 Update function parameter name
Function parameter name when sending user message and file message has changed from onCompleted to handler.
The migration process is now complete. We highly recommend a thorough review and testing of all app features to ensure seamless operation with the Sendbird Chat SDK v4.