A Flutter plugin for CrashX analytics. specific for flutter apps.
- Automatic Error Catching: Hooks into
FlutterError.onErrorandPlatformDispatcher.instance.onErrorto capture uncaught exceptions. - Metadata Collection: Automatically collects device info (OS, Model, Version) and App Version.
- Manual Reporting: Manually report errors using
CrashX.recordError. - Offline Support: (Coming Soon)
- Add
crashxto yourpubspec.yamldependencies. - Initialize the plugin in your
main.dart.
import 'package:flutter/material.dart';
import 'package:crashx/crashx.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize CrashX with your API Key
await CrashX.init(
apiKey: "YOUR_PROJECT_API_KEY",
);
runApp(const MyApp());
}Once initialized, CrashX automatically captures uncaught errors in your Flutter app.
You can also manually report errors:
try {
// Some dangerous code
} catch (e, stack) {
CrashX.recordError(e, stack);
}