All Products
Search
Document Center

Cloud Monitor:Integrate a Flutter application

Last Updated:Jul 24, 2026

The Alibaba Cloud Real User Monitoring (RUM) plugin for Flutter currently supports Android, iOS, and HarmonyOS platforms.

Version requirements

  • Flutter: 3.0.0 or later

  • iOS: 12.0 or later

  • Android: 7.0 or later

  • HarmonyOS: API 12 or later

Integrate a plugin

1. Add the dependency

Add the following dependency to the pubspec.yaml file of your Flutter project:

dependencies:
  flutter:
    sdk: flutter

  alibabacloud_rum_flutter_plugin: ^2.3.6

2. Run the following command in the root directory of your Flutter project

flutter packages get

3. (iOS only) Run the following command in the ios directory of your project

pod install

4. Initialize the SDK

Import the following package in the main.dart file:

import 'package:alibabacloud_rum_flutter_plugin/alibabacloud_rum_flutter_plugin.dart';

Initialize the SDK:

void main() {
  // Comment out the original runApp() method
  // runApp(MyApp());
  // (Required) Initialize the SDK
  AlibabaCloudRUM().start(MyApp());
  // (Optional) Set a custom username
  AlibabaCloudRUM().setUserName("xxxxxx");
}

5. (Optional) Capture action events

The RUM Flutter plugin supports capturing Flutter click and other action events. You need to configure and use AlibabaCloudActionCapture to capture user click events. The following is a usage example:

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return AlibabaCloudActionCapture(
          child: Scaffold(
          appBar: AppBar(
            title: const Text('AlibabaCloudRUM'),
          ),
          body: // Your other code
        ));
  }
}

6. Verify the integration

After the Flutter application starts, if [INFO][AlibabaCloudRUM]: alibabacloud_rum_flutter_plugin initialized successfully is returned in DEBUG CONSOLE, the SDK integration is successful. Example:

flutter: [2024-05-27 16:43:39][INFO][AlibabaCloudRUM]: alibabacloud_rum_flutter_plugin initialized successfully

For more information about SDK configuration, such as route listening, error callbacks, custom events, and resource snapshot collection, see SDK configuration reference.

Integrate a Native SDK

When integrating the Alibaba Cloud RUM SDK in a Flutter project, in addition to the Flutter plugin, you also need to integrate the Android, iOS, and HarmonyOS SDKs separately. See the following documents for integration: