ve_apm 2.5.0 ve_apm: ^2.5.0 copied to clipboard
A flutter plugin for veMars APM.
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:ve_apm/ve_apm.dart';
import 'common/router.dart';
import 'pages/home_page.dart';
void main() {
runTraceApp((observer) {
HttpOverrides.global = ApmHttpOverrides();
enableVeApmLog(true);
return MyApp(observer);
});
}
class MyApp extends StatefulWidget {
MyApp([this._navigatorObserver]);
NavigatorObserver? _navigatorObserver;
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: HomePage(),
navigatorObservers: <NavigatorObserver>[
widget._navigatorObserver ?? ApmNavigatorObserver.instance
],
routes: generateRoutes(),
);
}
}