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

Installation

Cloudsmith

Add the Cloudsmith hosted repository and dependency to your pubspec.yaml:
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.