Skip to content
pubscout

catcher

0.8.0, released 3 years ago by hasoft.pl

Plugin for automatic error catching and handling in Flutter applications.

$ flutter pub add catcher
Source repository

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.

  • logger

    Pick logger if you only need structured console logging rather than comprehensive crash handling workflows with dialogs and remote reporting.

  • talker

    Pick talker if you want a modern, highly extensible error and log management tool with built-in UI screens.

Works with

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