On this page, you will learn how to perform initial setup for Flutter frontends.
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
Experience Vitals > Overview.
Experience Vitals.dynatrace.config.yaml file and save it into your project root.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:
flutter pub get.Configure the plugin using the dynatrace.config.yaml file.
dynatrace.config.yaml file from the wizard.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.
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());}
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.
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.
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).
Experience Vitals > Overview.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.
After completing the initial setup, consider exploring the following topics to enhance your monitoring capabilities: