flutter_app_insights 0.0.1 copy "flutter_app_insights: ^0.0.1" to clipboard
flutter_app_insights: ^0.0.1 copied to clipboard

A library that helps your product connect to Microsoft AppInsights. Supports All Platforms

example/lib/main.dart

// example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:flutter_app_insights/flutter_app_insights.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  InsightsClient.instance.configure(
    instrumentationKey: 'MY INSIGHTS KEY',
    timerUploadInSeconds: 30,
    countOfRecordsToUploadViaBatch: 10,
    allowCrashReporting: true,
    allowInternalLogging: true,
  );

  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext ctx) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('flutter_app_insights example')),
        body: Center(
          child: ElevatedButton(
            onPressed: () {
              InsightsClient.instance.writeTrace(
                message: {'env': 'dev'},
                eventName: 'Sample Event Name',
                level: TraceSeverityLevel.Information,
              );
            },
            child: const Text('Send trace'),
          ),
        ),
      ),
    );
  }
}
3
likes
140
points
71
downloads

Publisher

verified publisheraresdefencelabs.com

Weekly Downloads

A library that helps your product connect to Microsoft AppInsights. Supports All Platforms

Repository (GitHub)
View/report issues

Topics

#telemetry #appinsights #logging #analytics

Documentation

Documentation
API reference

License

Apache-2.0 (license)

Dependencies

dio, flutter, json_annotation, path_provider, retrofit

More

Packages that depend on flutter_app_insights