Initial setup for Flutter frontends

  • Latest Dynatrace
  • How-to guide
  • 1-min read
  • Published Dec 24, 2025

On this page, you will learn how to perform initial setup for Flutter frontends.

Prerequisites

Before you begin, ensure your environment meets the following requirements:

Requirement

Minimum Version

Flutter

3.10.0

Dart

3.0.0

Android API Level

21

iOS SDK

12

Gradle

7.x

Android Gradle Plugin

7.0

Java

11

Enable the New RUM Experience for a mobile frontend

  1. Go to Experience Vitals Experience Vitals > Overview.
  2. Select Mobile to view all mobile frontends.
  3. Select the frontend you want to configure.
  4. Navigate to the Settings tab.
  5. Under Enablement and cost control, turn on New Real User Monitoring Experience.

Enable the New RUM Experience at the environment level

  1. Go to Settings Settings > Collect and capture > Real User Monitoring > Mobile frontends > Traffic and cost control.
  2. Turn on Enable New Real User Monitoring Experience.

Initial Setup

1. Create a Dynatrace mobile application

  1. Go to Experience Vitals Experience Vitals.
  2. Select Add Frontend in the upper-right corner.
  3. Follow the steps in the Frontend creation wizard.
  4. Select Flutter as your platform.
  5. Complete the wizard to generate your dynatrace.config.yaml file and save it into your project root.

2. Install the plugin

Add the Dynatrace Flutter plugin to your Flutter project dependencies.

Run the following command in your project root:

flutter pub add dynatrace_flutter_plugin

This adds the plugin to your pubspec.yaml file. Resolve any dependencies if needed:

  • Terminal—run flutter pub get.
  • IDE—select Pub get or Packages get in your editor.

3. Set up configuration

Configure the plugin using the dynatrace.config.yaml file.

  1. Download the dynatrace.config.yaml file from the wizard.
  2. Move the file to the root directory of your Flutter project.
  3. Run the configuration script:
dart run dynatrace_flutter_plugin

This command configures your Android and iOS native projects based on the settings in dynatrace.config.yaml.

For more details on configuration options, see the Advanced configuration guide.

4. Initialize the plugin

Initialize the Dynatrace plugin in your application's entry point.

Replace your standard main() function with one of the following initialization methods:

Use Dynatrace().start() to wrap your root widget.

import 'package:dynatrace_flutter_plugin/dynatrace_flutter_plugin.dart';
void main() {
Dynatrace().start(MyApp());
}

Option 2: Initialization without a Widget

Use Dynatrace().startWithoutWidget() if you need to control runApp() yourself.

import 'package:dynatrace_flutter_plugin/dynatrace_flutter_plugin.dart';
void main() {
Dynatrace().startWithoutWidget();
runApp(MyApp());
}

Initialization without a widget may require additional setup for certain features.

5. Build and run

Build and run your application to verify the installation.

flutter run

Once the application is running, perform some actions to generate traffic. You should see data appearing in your Dynatrace environment shortly.

Verify your installation

After installing and configuring OneAgent, verify that data is being collected.

Open your app and perform several actions (navigate between screens, tap buttons, and make network requests).

  1. Go to Experience Vitals Experience Vitals > Overview.
  2. Select Mobile to view all mobile frontends.
  3. Select the frontend you want to configure.
  4. Verify that sessions and user actions appear in the data.

This data can also be analyzed directly in Grail using DQL.

It may take a few minutes for data to appear in Dynatrace after the first app launch.

Next steps

After completing the initial setup, consider exploring the following topics to enhance your monitoring capabilities:

Related tags
Digital Experience