flutter_metrics_sdk 1.1.0
flutter_metrics_sdk: ^1.1.0 copied to clipboard
A lightweight Flutter performance analytics SDK to capture real-user metrics such as render time, frame drops, user interactions, and crashes.
Flutter Metrics SDK #
A Flutter performance analytics SDK that captures real-user performance metrics and sends them securely to a web-based dashboard for analysis and optimization.
๐ Features #
- Screen render time tracking
- Frame drop (UI jank) detection
- User interaction tracking
- Crash signal reporting
- Secure API key-based ingestion
- Non-blocking and production-safe design
- Supports Android, iOS, and Web
๐ฆ Installation #
Add the dependency to your pubspec.yaml:
dependencies:
flutter_metrics_sdk: ^1.0.0
Then run:
flutter pub get
๐ Dashboard Setup (Required) #
This SDK integrates with a web-based performance dashboard.
Dashboard URL #
https://ai-performance-intelligence-dashboa.vercel.app
Setup Steps #
- Create an account on the dashboard
- Create an application
- Copy the generated API key
- Use the API key while initializing the SDK
Backend API URL #
https://ai-performance-intelligence-backend.onrender.com
โ๏ธ Initialization #
final metrics = MetricsClient(
apiKey: 'app_live_xxxxxxxxx',
baseUrl: 'https://ai-performance-intelligence-backend.onrender.com',
);
๐งช Usage #
Track screen render time #
metrics.sendMetric(
event: 'screen_render',
screen: 'home',
renderTimeMs: 420,
);
Track frame drops (UI jank) #
metrics.sendMetric(
event: 'frame_drop',
screen: 'profile',
frameTimeMs: 34,
frameDropped: true,
);
Track crash signals #
FlutterError.onError = (details) {
metrics.sendMetric(
event: 'app_crash',
screen: 'unknown',
);
};
๐ Security #
- Uses app-level API keys for metrics ingestion
- API keys are generated from the dashboard
- API keys should not be committed to source control
- Supports API key rotation
๐ Platform Support #
- Flutter Android
- Flutter iOS
- Flutter Web