catcher
0.8.0, released 3 years ago by hasoft.pl
Plugin for automatic error catching and handling in Flutter applications.
What it does
Catcher automatically captures uncaught errors and exceptions in Flutter applications. It provides multiple report modes (like dialogs, notifications, and pages) and various handlers to process errors by logging them to the console, sending emails, or reporting them to services like Sentry and Crashlytics.
AI-written summary of version 0.8.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need centralized error tracking and reporting across multiple platforms in Flutter.
- You want to prompt users with dialogs or notifications when an application crash occurs.
Skip it when
- You are looking for a simple logging-only utility without crash reporting workflows.
- You prefer an official lightweight APM SDK integration without UI report flows.
Strengths
- Supports multiple platforms including Android, iOS, Web, Windows, macOS, and Linux.
- Provides a wide variety of out-of-the-box handlers like Console, Email, Sentry, and Crashlytics.
- Offers customizable report modes and localization options.
Weaknesses
- Requires boilerplate code configuration and adding a specific navigator key.
- Might introduce heavy dependencies due to multiple built-in integrations.
Setup
- Kind
- Plugin (native code)
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 11
Requires adding the Catcher navigator key to your MaterialApp or CupertinoApp and configuring debug and release options in the main function.
import 'package:flutter/material.dart';
import 'package:catcher/catcher.dart';
main() {
CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [ConsoleHandler()]);
Catcher(rootWidget: MyApp(), debugConfig: debugOptions);
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
home: Scaffold(
body: Center(
child: TextButton(
child: Text("Generate error"),
onPressed: () => throw "Test exception",
),
),
),
);
}
}Alternatives
Packages that do the same job and could replace catcher.
Works with
Packages commonly used together with catcher: ones it builds on, ones built on it, and its own family.
- loggingcatcher depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- package_info_pluscatcher depends on itFlutter plugin to query app package info like version, build number and installer store.
- diocatcher depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- device_info_pluscatcher depends on itProvides detailed information about the current device, make, model, and OS version.
- universal_iocatcher depends on itCross-platform dart:io implementation with browser support for HttpClient and other APIs
- sentrycatcher depends on itCrash reporting and error tracking library for Dart and Flutter applications.
- very_good_analysiscatcher depends on itLint rules for Dart and Flutter used internally at Very Good Ventures.
- fluttertoastcatcher depends on itEasily create toast messages with or without BuildContext in Flutter.