Skip to main content

Import the SDK

Requirements

  • Dart: ≥ 2.15.0 < 4.0.0
  • Flutter: ≥ 2.5.0

Install the SDK

The Chat SDK for Flutter is distributed as a plugin package that includes both the Dart layer and native Android and iOS platform code.

  1. Add the dependency to your project's pubspec.yaml.

    yaml
    dependencies:
    flutter:
    sdk: flutter

    rongcloud_im_wrapper_plugin: x.y.z
    tip

    Replace x.y.z with the version you want to use. Check the official repository for the latest version. The first three digits of the Flutter plugin version match the native SDK version. For example, Flutter SDK version 5.2.4 uses native SDK version 5.2.4.

  2. Run flutter pub get in your project directory to download the plugin.

  3. Import the package.

    Dart
    import 'package:rongcloud_im_wrapper_plugin/rongcloud_im_wrapper_plugin.dart';

Disable Android code obfuscation

For ProGuard rules, see the Android documentation.

If you don't need obfuscation, disable it. Otherwise, flutter build apk may obfuscate Android code and cause .so library errors.

Groovy
android {
buildTypes {
release {
// Enables code shrinking, obfuscation, and optimization for only
// your project's release build type.
minifyEnabled false

// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
shrinkResources false
}
}
...
}