Skip to content
pubscout

catcher_2

3.0.0, released today by femtopedia.de

Plugin for automatic error catching and handling in Flutter apps.

Uses material_uiRock solid
$ flutter pub add catcher_2
Source repository

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.

  • sentry_logging

    Adds Sentry logging integration for the Dart logging package

  • talker

    Advanced error handler and logger package for Flutter and Dart apps.

  • talker_flutter

    Advanced error handler and logger package for Flutter and Dart applications

Works with

Packages commonly used together with catcher_2: ones it builds on, ones built on it, and its own family.