Skip to main content
This guide helps you migrate your Flutter application from CometChat SDK v4 to v5.

Installation

Add the CometChat Dependency

Update your pubspec.yaml to the latest v5 SDK:
Then run:

What’s Changed

New

  • All platform channel method calls have been replaced with native Dart implementations, resulting in significant speed and performance improvements.
  • The SDK now runs entirely on Dart by default, bringing cross-platform support to iOS, Android, and Web.

Breaking Changes

  • onTypingIndicator() now returns Stream<TypingIndicator> instead of Stream<String>. Typing events include sender, receiverId, receiverType, metadata, lastTimestamp, and typingStatus fields. Use TypingIndicator.typingStatus (“started” or “ended”) instead of checking methodName. No EventChannel dependency — works on all platforms including web. Existing MessageListener callbacks (onTypingStarted / onTypingEnded) continue to work unchanged.
Before (v4):
After (v5):

Removals

  • Removed deprecated markAsUnread() method. Use markMessageAsUnread() instead.
Before (v4):
After (v5):
  • Removed deprecated receaverUid parameter from startTyping() and endTyping(). Use receiverUid instead.
Before (v4):
After (v5):
  • Removed deprecated fetchPushPreferences(), updatePushPreferences(), and resetPushPreferences() methods. Use fetchPreferences(), updatePreferences(), and resetPreferences() instead.
Before (v4):
After (v5):
  • Removed deprecated PushPreferences class. Use NotificationPreferences instead.