catcher_2
3.0.0, released today by femtopedia.de
Plugin for automatic error catching and handling in Flutter apps.
What it does
Catcher 2 automatically catches uncaught errors and exceptions in Flutter applications and offers multiple ways to handle them, such as logging to the console, showing dialogs, sending emails, or reporting to Sentry, Slack, and Discord.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want to automatically catch uncaught application errors and exceptions.
- You need multiple reporting handlers like email, console, Sentry, or custom HTTP endpoints.
Skip it when
- You only require basic crash reporting without any custom UI prompts or handlers.
Strengths
- Supports multiple handlers including console, email, Sentry, Slack, Discord, and HTTP.
- Provides built-in report modes like dialogs, notifications, and dedicated pages.
- Cross-platform support across Android, iOS, Web, Linux, Windows, and macOS.
Weaknesses
- Requires integrating the navigator key and wrapping the root widget.
- Some handlers have breaking changes depending on external library versions like Dio.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 14
Add catcher_2 to pubspec.yaml, add the Catcher2 navigator key to MaterialApp or CupertinoApp, and configure options for debug and release modes.
import 'package:material_ui/material_ui.dart';
import 'package:catcher_2/catcher_2.dart';
main() {
Catcher2Options debugOptions =
Catcher2Options(DialogReportMode(), [ConsoleHandler()]);
Catcher2(rootWidget: MyApp(), debugConfig: debugOptions);
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
navigatorKey: Catcher2.navigatorKey,
home: Scaffold(
appBar: AppBar(title: const Text('Catcher 2 Example')),
body: Center(child: TextButton(
child: Text('Generate error'),
onPressed: () => throw 'Test exception',
)),
),
);
}
}Alternatives
Packages that do the same job and could replace catcher_2.
- catcher
Plugin for automatic error catching and handling in Flutter applications.
50Compare - sentry_logging
Adds Sentry logging integration for the Dart logging package
90Compare - talker
Advanced error handler and logger package for Flutter and Dart apps.
94Compare - talker_flutter
Advanced error handler and logger package for Flutter and Dart applications
93Compare
Works with
Packages commonly used together with catcher_2: ones it builds on, ones built on it, and its own family.
- webcatcher_2 depends on itLightweight bindings for browser APIs via JS interop
- loggingcatcher_2 depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- package_info_pluscatcher_2 depends on itFlutter plugin to query app package info like version, build number and installer store.
- diocatcher_2 depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- device_info_pluscatcher_2 depends on itProvides detailed information about the current device, make, model, and OS version.
- material_uicatcher_2 depends on itOfficial Flutter Material UI library implementing Google’s Material Design system.
- cupertino_uicatcher_2 depends on itOfficial Flutter Cupertino design library implementing Apple HIG iOS and macOS user interfaces.
- universal_iocatcher_2 depends on itCross-platform dart:io implementation with browser support for HttpClient and other APIs