appdynamics_agent 24.7.0 copy "appdynamics_agent: ^24.7.0" to clipboard
appdynamics_agent: ^24.7.0 copied to clipboard

Flutter plugin to integrate AppDynamics Mobile Real User Monitoring with your app.

example/example.md

/*
* Copyright (c) 2022. AppDynamics LLC and its affiliates.
* All rights reserved.
*
*/

/// Complete example with all Flutter agent's features.

import 'dart:async';

import 'package:appdynamics_agent/appdynamics_agent.dart';
import 'package:appdynamics_agent_example/routing/on_generate_route.dart';
import 'package:appdynamics_agent_example/routing/route_paths.dart';
import 'package:flutter/material.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  FlutterError.onError = Instrumentation.errorHandler;
  PlatformDispatcher.instance.onError = (error, stack) {
    final details = FlutterErrorDetails(exception: error, stack: stack);
    Instrumentation.errorHandler(details);
    return true;
  };
  
  crashReportCallback(List<CrashReportSummary> summaries) async {
    // ... handle crash reports
  }

  AgentConfiguration config = AgentConfiguration(
      appKey: "<EUM_APP_KEY>",
      loggingLevel: LoggingLevel.verbose,
      collectorURL: "https://www.<collector-url>.com",
      screenshotURL: "https://www.<screenshots-url>.com",
      crashReportCallback: crashReportCallback,
      screenshotsEnabled: true,
      crashReportingEnabled: true
  );
  await Instrumentation.start(config);
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        initialRoute: RoutePaths.settings,
        onGenerateRoute: onGenerateRoute,
        navigatorObservers: [NavigationObserver()]);
  }
}
18
likes
150
points
11.3k
downloads

Publisher

verified publisherappdynamics.com

Weekly Downloads

Flutter plugin to integrate AppDynamics Mobile Real User Monitoring with your app.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

dio, flutter, http

More

Packages that depend on appdynamics_agent