The web content provides a comprehensive guide on setting up the Catcher plugin for error handling in Flutter applications, including integration with services like Sentry, Firebase Crashlytics, and Slack, and demonstrates how to implement it for crash reporting and app monitoring.
Abstract
The article "Expert Catcher SetUp For Flutter Apps" details the process of integrating the Catcher plugin into Flutter apps to manage and report errors effectively. It covers the necessary dependencies for Catcher and Firebase Crashlytics, offers guidance on configuring Catcher options for different reporting modes, and explains how to handle device information and screenshots. The author, Fred Grott, also provides examples of helper functions and classes, and illustrates how to use Catcher in the main application file. Additionally, the article discusses the setup for additional services like Sentry and Slack, and concludes with the author's personal background and where to find more of their work.
Opinions
The author positions themselves as an authority on the subject, having contributed corrections to the Catcher Example and providing detailed setup instructions.
The preference for manual email triggers for error reports is emphasized, suggesting a hands-on approach to error management.
The author's approach to writing a Flutter Dev App series of books during COVID-19 indicates a proactive and resourceful mindset in technical writing and software development.
By organically creating book chapters through Medium articles, the author implies a non-traditional, iterative approach to content creation and learning.
The author's self-description as a "reformed ADHD’er and Code and Design Cowboy" suggests a personal journey of growth and self-improvement in their professional life.
Expert Catcher SetUp For Flutter Apps
In Flutter, we use the Catcher plugin to integrate with Sentry, Crashanalytics, Slack, etc. to collect and send app crash reports. Since I just sent a correction to the Catcher Example as a patch, I am probably the best one to explain how to set up to use this Catcher plugin.
Sentry dependency is already included with Catcher but Firebase Crashanalytics is not, so you need to include it if using the crash analytics features. To install Catcher in your pubspec:
dependencies:
catcher: ^0.6.7
If you need Firebase Crashanalytics features of Catcher then to install Firebase Crashanalytics in the pubspec it’s:
dependencies:
firebase_crashlytics: ^2.0.7
And, remember if using the Sentry features to sign for an App DSN from Sentry:
If you are using firebase crashanalytics then you put the handler for that right before the ConsoleHander.
PageReportMode, the full page report mode I am using, can include a stacktrace; so I have it set to true. In the catcher options, if you are using sentry then you have to declare your app DSN from sentry:
We have none of the setup plugins to collect device information, as Catcher already handles that set of requirements.
Now to show how to use these helper functions and classes.
The Call In Main
Then use them in main:
If you want to simplify things, you can use the simple short error widget that catcher provides by using this in your myapp dart file right before your home widget:
builder: (BuildContext context, Widget? widget) {
Catcher.addDefaultErrorWidget(
// ignore: avoid_redundant_argument_values
showStacktrace:true,
title:"Error Report",
description:"Error description",
// ignore: avoid_redundant_argument_values
maxWidthForSmallMode: 150,);
return widget!;
},
I use the Catcher full report page mode, so I need to set up a GlobalKey navigaorKey right before my Catcher block:
I have shown you the preferred setup where the catcher report is manually email triggered to the email you provide along with the full page mode setup with the additional how to do the Sentry set up, firebase Crashanalytics, and Slack.
About Me, Fred Grott
I am a reformed Android, Java, Kotlin, and Front-End developer. I am a reformed ADHD’er and Code and Design Cowboy. And I am the nut starting to write a Flutter Dev App series of books during COIVD. Not only that, but I am organically creating my Flutter Developer Book chapters via Medium article writing, which is at:
The more formalized almost ready for book code is at: