Skip to main content

Overview

WuKongIM Flutter EasySDK is a lightweight Flutter SDK that enables you to add real-time chat functionality to your Flutter application in just 5 minutes. This guide will take you through the complete process from installation to sending your first message.
System Requirements: Flutter 3.0.0 or higher, Dart 2.17.0 or higher

Step 1: Install SDK

Add dependency to your pubspec.yaml:
Then run:

Step 2: Basic Integration

2.1 Import SDK

2.2 Initialize SDK

2.3 Listen for Events

2.4 Remove Event Listeners

In some cases, you may need to remove event listeners to avoid memory leaks or duplicate processing. Flutter EasySDK provides methods to remove listeners.
Important Reminder: In Flutter, removing event listeners requires maintaining references to the listeners. It’s recommended to use class properties to store listener references for later removal.

Correct Usage

2.5 Connect to Server

2.6 Send Messages

Step 3: Error Handling and Best Practices

3.1 Error Handling

Built-in Auto Reconnection: Flutter EasySDK has built-in intelligent reconnection mechanism, no need to manually implement reconnection logic. The SDK will automatically attempt to reconnect when the connection is lost.

Complete Example Code

View complete example code and more feature demonstrations

Complete Protocol Documentation

View WuKongIM’s complete protocol documentation

GitHub Repository

Visit EasyJSSDK’s GitHub repository

Issue Feedback

Report issues or provide suggestions

Next Steps

Congratulations! You have successfully integrated WuKongIM Flutter EasySDK. Now you can:
  1. Extend Functionality: Add group chat, file transfer and other features
  2. Customize UI: Customize chat interface according to your app design
  3. Integrate into Project: Integrate chat functionality into your existing project
  4. Performance Optimization: Optimize performance based on actual usage
If you need more complex functionality or higher performance requirements, consider using the full version of WuKongIMSDK.