diff --git a/.flutter-plugins b/.flutter-plugins
new file mode 100644
index 00000000..f245cd0b
--- /dev/null
+++ b/.flutter-plugins
@@ -0,0 +1,5 @@
+# This is a generated file; do not edit or check into version control.
+device_info_plus=C:\\Users\\nicom\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\device_info_plus-9.0.3\\
+flutter_mailer=C:\\Users\\nicom\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\flutter_mailer-2.1.1\\
+fluttertoast=C:\\Users\\nicom\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\fluttertoast-8.2.2\\
+package_info_plus=C:\\Users\\nicom\\AppData\\Local\\Pub\\Cache\\hosted\\pub.dev\\package_info_plus-4.1.0\\
diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies
new file mode 100644
index 00000000..5814c82e
--- /dev/null
+++ b/.flutter-plugins-dependencies
@@ -0,0 +1 @@
+{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"device_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.3\\\\","native_build":true,"dependencies":[]},{"name":"flutter_mailer","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_mailer-2.1.1\\\\","native_build":true,"dependencies":[]},{"name":"fluttertoast","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\fluttertoast-8.2.2\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.1.0\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"device_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.3\\\\","native_build":true,"dependencies":[]},{"name":"flutter_mailer","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\flutter_mailer-2.1.1\\\\","native_build":true,"dependencies":[]},{"name":"fluttertoast","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\fluttertoast-8.2.2\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.1.0\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"device_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.3\\\\","native_build":true,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.1.0\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"device_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.3\\\\","native_build":false,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.1.0\\\\","native_build":false,"dependencies":[]}],"windows":[{"name":"device_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.3\\\\","native_build":false,"dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.1.0\\\\","native_build":false,"dependencies":[]}],"web":[{"name":"device_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\device_info_plus-9.0.3\\\\","dependencies":[]},{"name":"fluttertoast","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\fluttertoast-8.2.2\\\\","dependencies":[]},{"name":"package_info_plus","path":"C:\\\\Users\\\\nicom\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\package_info_plus-4.1.0\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"device_info_plus","dependencies":[]},{"name":"flutter_mailer","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"package_info_plus","dependencies":[]}],"date_created":"2023-09-26 20:30:03.646144","version":"3.13.5"}
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index 85b082f2..7f3caf68 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -3,7 +3,7 @@ name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: New issue
-assignees: jhomlala
+assignees: ThexXTURBOXx
---
@@ -26,7 +26,7 @@ If applicable, add screenshots to help explain your problem.
**Flutter doctor**
Please add flutter doctor output here.
-**Catcher version**
+**Catcher 2 version**
- Version:
**Smartphone (please complete the following information):**
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
index 7cf0bce3..d71f7196 100644
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -3,7 +3,7 @@ name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: New issue, enhancement
-assignees: jhomlala
+assignees: ThexXTURBOXx
---
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7e439f6c..f22499fd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -13,7 +13,7 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Check format
run: dart format --output=none --set-exit-if-changed .
@@ -24,7 +24,7 @@ jobs:
steps:
- name: Checkout code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Get dependencies for example
run: flutter pub get
working-directory: example
diff --git a/.gitignore b/.gitignore
index a07e487e..96486fd9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,23 +1,30 @@
+# Miscellaneous
+*.class
+*.log
+*.pyc
+*.swp
.DS_Store
-.dart_tool/
-.idea
+.atom/
+.buildlog/
+.history
+.svn/
+migrate_working_dir/
-.packages
-.pub/
+# IntelliJ related
+*.iml
+*.ipr
+*.iws
.idea/
-build/
-ios/.generated/
-ios/Flutter/Generated.xcconfig
-ios/Runner/GeneratedPluginRegistrant.*
-example/macos/Flutter/
-example/linux/flutter/
-
-*.txt
-android/.gradle
+# The .vscode folder contains launch configuration and tasks you configure in
+# VS Code which you may wish to be included in version control, so this line
+# is commented out by default.
+#.vscode/
-.flutter-plugins
-.flutter-plugins-dependencies
-flutter_export_environment.sh
-*.lock
-.vscode
+# Flutter/Dart/Pub related
+# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
+/pubspec.lock
+**/doc/api/
+.dart_tool/
+.packages
+build/
diff --git a/README.md b/README.md
index 5381e79b..69ead887 100644
--- a/README.md
+++ b/README.md
@@ -1,18 +1,18 @@
-
+
-# Catcher
+# Catcher 2
[![pub package](https://img.shields.io/pub/v/catcher.svg)](https://pub.dartlang.org/packages/catcher)
-[![pub package](https://img.shields.io/github/license/jhomlala/catcher.svg?style=flat)](https://github.com/jhomlala/catcher)
-[![pub package](https://img.shields.io/badge/platform-flutter-blue.svg)](https://github.com/jhomlala/catcher)
+[![pub package](https://img.shields.io/github/license/ThexXTURBOXx/catcher_2.svg?style=flat)](https://github.com/ThexXTURBOXx/catcher_2)
+[![pub package](https://img.shields.io/badge/platform-flutter-blue.svg)](https://github.com/ThexXTURBOXx/catcher_2)
[![pub package](https://img.shields.io/badge/Awesome-Flutter-blue.svg?longCache=true&style=flat-square)](https://github.com/Solido/awesome-flutter)
-Catcher is Flutter plugin which automatically catches error/exceptions and handle them. Catcher offers multiple way to handle errors.
-Catcher is heavily inspired from ACRA: https://github.com/ACRA/acra.
-Catcher supports Android, iOS, Web, Linux, Windows and MacOS platforms.
+Catcher 2 is Flutter plugin which automatically catches error/exceptions and handle them. Catcher 2 offers multiple way to handle errors.
+Catcher 2 is heavily inspired from ACRA: https://github.com/ACRA/acra.
+Catcher 2 supports Android, iOS, Web, Linux, Windows and MacOS platforms.
## Install
@@ -20,7 +20,7 @@ Catcher supports Android, iOS, Web, Linux, Windows and MacOS platforms.
Add this line to your **pubspec.yaml**:
```yaml
dependencies:
- catcher: ^0.8.0
+ catcher_2: ^1.0.0
```
Then run this command:
@@ -30,15 +30,15 @@ $ flutter packages get
Then add this import:
```dart
-import 'package:catcher/catcher.dart';
+import 'package:catcher_2/catcher_2.dart';
```
## Table of contents
[Platform support](#platform-support)
[Basic example](#basic-example)
-[Catcher usage](#catcher-usage)
+[Catcher 2 usage](#catcher-2-usage)
[Adding navigator key](#adding-navigator-key)
-[Catcher configuration](#catcher-configuration)
+[Catcher 2 configuration](#catcher-2-configuration)
[Report caught exception](#report-caught-exception)
[Localization](#localization)
@@ -70,35 +70,35 @@ import 'package:catcher/catcher.dart';
[Screenshots](#screenshots)
## Platform support
-To check which features of Catcher are available in given platform visit this page: [Platform support](https://github.com/jhomlala/catcher/blob/master/platform_support.md)
+To check which features of Catcher 2 are available in given platform visit this page: [Platform support](https://github.com/ThexXTURBOXx/catcher_2/blob/master/platform_support.md)
## Basic example
Basic example utilizes debug config with Dialog Report Mode and Console Handler and release config with Dialog Report Mode and Email Manual Handler.
-To start using Catcher, you have to:
-1. Create Catcher configuration (you can use only debug config at start)
-2. Create Catcher instance and pass your root widget along with catcher configuration
+To start using Catcher 2, you have to:
+1. Create Catcher 2 configuration (you can use only debug config at start)
+2. Create Catcher 2 instance and pass your root widget along with its configuration
3. Add navigator key to MaterialApp or CupertinoApp
Here is complete example:
```dart
import 'package:flutter/material.dart';
-import 'package:catcher/catcher.dart';
+import 'package:catcher_2/catcher_2.dart';
main() {
- /// STEP 1. Create catcher configuration.
+ /// STEP 1. Create Catcher 2 configuration.
/// Debug configuration with dialog report mode and console handler. It will show dialog and once user accepts it, error will be shown /// in console.
- CatcherOptions debugOptions =
- CatcherOptions(DialogReportMode(), [ConsoleHandler()]);
+ Catcher2Options debugOptions =
+ Catcher2Options(DialogReportMode(), [ConsoleHandler()]);
/// Release configuration. Same as above, but once user accepts dialog, user will be prompted to send email with crash to support.
- CatcherOptions releaseOptions = CatcherOptions(DialogReportMode(), [
+ Catcher2Options releaseOptions = Catcher2Options(DialogReportMode(), [
EmailManualHandler(["support@email.com"])
]);
- /// STEP 2. Pass your root widget (MyApp) along with Catcher configuration:
- Catcher(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions);
+ /// STEP 2. Pass your root widget (MyApp) along with Catcher 2 configuration:
+ Catcher2(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
@@ -115,8 +115,8 @@ class _MyAppState extends State {
@override
Widget build(BuildContext context) {
return MaterialApp(
- /// STEP 3. Add navigator key from Catcher. It will be used to navigate user to report page or to show dialog.
- navigatorKey: Catcher.navigatorKey,
+ /// STEP 3. Add navigator key from Catcher 2. It will be used to navigate user to report page or to show dialog.
+ navigatorKey: Catcher2.navigatorKey,
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
@@ -142,95 +142,97 @@ class ChildWidget extends StatelessWidget {
```
If you run this code you will see screen with "Generate error" button on the screen.
-After clicking on it, it will generate test exception, which will be handled by Catcher. Before Catcher process exception to handler, it will
+After clicking on it, it will generate test exception, which will be handled by Catcher 2. Before Catcher 2 process exception to handler, it will
show dialog with information for user. This dialog is shown because we have used DialogReportHandler. Once user confirms action in this dialog,
report will be send to console handler which will log to console error information.
-## Catcher usage
+## Catcher 2 usage
### Adding navigator key
-In order to make work Page Report Mode and Dialog Report Mode, you must include navigator key. Catcher plugin exposes key which must be included in your MaterialApp or WidgetApp:
+In order to make work Page Report Mode and Dialog Report Mode, you must include navigator key. Catcher 2 plugin exposes key which must be included in your MaterialApp or WidgetApp:
```dart
@override
Widget build(BuildContext context) {
return MaterialApp(
//********************************************
- navigatorKey: Catcher.navigatorKey,
+ navigatorKey: Catcher2.navigatorKey,
//********************************************
home: Scaffold(
appBar: AppBar(
@@ -241,35 +243,35 @@ In order to make work Page Report Mode and Dialog Report Mode, you must include
}
```
-You need to provide this key, because Catcher needs context of navigator to show dialogs/pages. There is no need to include this navigator key if you won't use Page/Dialog Report Mode.
-You can also provide your own navigator key if need to. You can provide it with Catcher constructor (see below). Please check custom navigator key example to see basic example.
+You need to provide this key, because Catcher 2 needs context of navigator to show dialogs/pages. There is no need to include this navigator key if you won't use Page/Dialog Report Mode.
+You can also provide your own navigator key if need to. You can provide it with Catcher 2 constructor (see below). Please check custom navigator key example to see basic example.
-### Catcher configuration
-Catcher instance needs rootWidget or runAppFunction in setup time. Please provide one of it.
+### Catcher 2 configuration
+Catcher 2 instance needs rootWidget or runAppFunction in setup time. Please provide one of it.
* rootWidget (optional) - instance of your root application widget
* runAppFunction (optional) - function where runApp() will be called
-* debugConfig (optional) - config used when Catcher detects that application runs in debug mode
-* releaseConfig (optional) - config used when Catcher detects that application runs in release mode
-* profileConfig (optional) - config used when Catcher detects that application runs in profile mode
-* enableLogger (optional) - enable/disable internal Catcher logs
-* navigatorKey (optional) - provide optional navigator key from outside of Catcher
-* ensureInitialized (optional) - should Catcher run WidgetsFlutterBinding.ensureInitialized() during initialization
+* debugConfig (optional) - config used when Catcher 2 detects that application runs in debug mode
+* releaseConfig (optional) - config used when Catcher 2 detects that application runs in release mode
+* profileConfig (optional) - config used when Catcher 2 detects that application runs in profile mode
+* enableLogger (optional) - enable/disable internal Catcher 2 logs
+* navigatorKey (optional) - provide optional navigator key from outside of Catcher 2
+* ensureInitialized (optional) - should Catcher 2 run WidgetsFlutterBinding.ensureInitialized() during initialization
```dart
main() {
- CatcherOptions debugOptions =
- CatcherOptions(DialogReportMode(), [ConsoleHandler()]);
- CatcherOptions releaseOptions = CatcherOptions(DialogReportMode(), [
+ Catcher2Options debugOptions =
+ Catcher2Options(DialogReportMode(), [ConsoleHandler()]);
+ Catcher2Options releaseOptions = Catcher2Options(DialogReportMode(), [
EmailManualHandler(["recipient@email.com"])
]);
- CatcherOptions profileOptions = CatcherOptions(
+ Catcher2Options profileOptions = Catcher2Options(
NotificationReportMode(), [ConsoleHandler(), ToastHandler()],
handlerTimeout: 10000, customParameters: {"example"c: "example_parameter"},);
- Catcher(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions, profileConfig: profileOptions, enableLogger: false, navigatorKey: navigatorKey);
+ Catcher2(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions, profileConfig: profileOptions, enableLogger: false, navigatorKey: navigatorKey);
}
```
-CatcherOptions parameters:
+Catcher2Options parameters:
handlers - list of handlers, which will process report, see handlers to get more information.
handlerTimeout - timeout in milliseconds, this parameter describes max time of handling report by handler.
reportMode - describes how error report will be shown to user, see report modes to get more information.
@@ -284,23 +286,23 @@ filterFunction - function used to filter errors which shouldn't be handled.
### Report caught exception
-Catcher won't process exceptions caught in try/catch block. You can send exception from try catch block to Catcher:
+Catcher 2 won't process exceptions caught in try/catch block. You can send exception from try catch block to Catcher 2:
```dart
try {
...
} catch (error,stackTrace) {
- Catcher.reportCheckedError(error, stackTrace);
+ Catcher2.reportCheckedError(error, stackTrace);
}
```
### Localization
-Catcher allows to create localizations for Report modes. To add localization support, you need setup
+Catcher 2 allows to create localizations for Report modes. To add localization support, you need setup
few things:
Add navigatorKey in your `MaterialApp`:
```dart
- navigatorKey: Catcher.navigatorKey,
+ navigatorKey: Catcher2.navigatorKey,
```
Add Flutter localizations delegates and locales in your MaterialApp:
@@ -315,9 +317,9 @@ Add Flutter localizations delegates and locales in your MaterialApp:
],
```
-Add localizationOptions in `CatcherOptions`:
+Add localizationOptions in `Catcher2Options`:
```dart
-CatcherOptions(
+Catcher2Options(
...
localizationOptions: [
LocalizationOptions("pl", notificationReportModeTitle: "My translation" ...),
@@ -399,11 +401,11 @@ LocalizationOptions.buildDefaultDutchOptions();
Complete Example:
```dart
import 'package:flutter/material.dart';
-import 'package:catcher/catcher.dart';
+import 'package:catcher_2/catcher_2.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
main() {
- CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
+ Catcher2Options debugOptions = Catcher2Options(DialogReportMode(), [
ConsoleHandler(),
HttpHandler(HttpRequestType.post, Uri.parse("https://httpstat.us/200"),
printLogs: true)
@@ -425,11 +427,11 @@ main() {
toastHandlerDescription: "Wystąpił błąd:",
)
]);
- CatcherOptions releaseOptions = CatcherOptions(NotificationReportMode(), [
+ Catcher2Options releaseOptions = Catcher2Options(NotificationReportMode(), [
EmailManualHandler(["recipient@email.com"])
]);
- Catcher(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions);
+ Catcher2(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions);
}
class MyApp extends StatefulWidget {
@@ -446,7 +448,7 @@ class _MyAppState extends State {
@override
Widget build(BuildContext context) {
return MaterialApp(
- navigatorKey: Catcher.navigatorKey,
+ navigatorKey: Catcher2.navigatorKey,
localizationsDelegates: [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
@@ -504,7 +506,7 @@ See localization options to change default texts.
-
+ Dialog report mode
@@ -522,7 +524,7 @@ See localization options to change default texts.
-
+ Page report mode
@@ -550,9 +552,9 @@ ConsoleHandler(
```dart
I/flutter ( 4820): ------- APP INFO -------
I/flutter ( 4820): version: 1.0
-I/flutter ( 4820): appName: catcher_example
+I/flutter ( 4820): appName: catcher_2_example
I/flutter ( 4820): buildNumber: 1
-I/flutter ( 4820): packageName: com.jhomlala.catcherexample
+I/flutter ( 4820): packageName: com.jhomlala.catcher_2_example
I/flutter ( 4820):
```
@@ -585,15 +587,15 @@ I/flutter ( 4820): versionSdk: 28
I/flutter ( 4820): versionSecurityPatch: 2018-08-05
```
-* enableCustomParameters (optional) - display in log section with custom parameters passed to Catcher constructor
+* enableCustomParameters (optional) - display in log section with custom parameters passed to Catcher 2 constructor
* enableStackTrace (optional) - display in log section with stack trace:
```dart
I/flutter ( 5073): ------- STACK TRACE -------
-I/flutter ( 5073): #0 _MyAppState.generateError (package:catcher_example/main.dart:38:5)
+I/flutter ( 5073): #0 _MyAppState.generateError (package:catcher_2_example/main.dart:38:5)
I/flutter ( 5073):
-I/flutter ( 5073): #1 _MyAppState.build. (package:catcher_example/main.dart:31:69)
+I/flutter ( 5073): #1 _MyAppState.build. (package:catcher_2_example/main.dart:31:69)
I/flutter ( 5073): #2 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:507:14)
I/flutter ( 5073): #3 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:562:30)
I/flutter ( 5073): #4 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:102:24)
@@ -639,7 +641,7 @@ Email Manual Handler parameters:
Email handler can be used to send automatically email with error reports. Email handler has multiple configuration parameters. Few of them are required, other are optional. These parameters are required:
```dart
- EmailAutoHandler("smtp.gmail.com", 587, "somefakeemail@gmail.com", "Catcher",
+ EmailAutoHandler("smtp.gmail.com", 587, "somefakeemail@gmail.com", "Catcher 2",
"FakePassword", ["myemail@gmail.com"])
```
We need to setup email smtp server, email account and recipient. Currently, only Gmail was tested and worked. You can try use other email providers, but there can be errors.
@@ -648,7 +650,7 @@ List of all parameters:
* smtpHost (required) - host address of your email, for example host for gmail is smtp.gmail.com
* smtpPort (required) - smtp port of your email, for example port for gmail is 587
-* senderEmail (required) - email from which Catcher will send email (it will be sender of error emails)
+* senderEmail (required) - email from which Catcher 2 will send email (it will be sender of error emails)
* senderName (required) - name of sender email
* senderPassword (required) - password for sender email
* recipients (required) - list which contains recipient emails
@@ -664,7 +666,7 @@ List of all parameters:
Example email:
-
+
#### Http Handler
@@ -687,10 +689,10 @@ All parameters list:
* enableCustomParameters (optional) - please look in console handler description
You can try using example backend server which handles logs. It's written in Java 8 and Spring Framework and uses material design.
-You can find code of backend server here: https://github.com/jhomlala/catcher/tree/master/backend
+You can find code of backend server here: https://github.com/ThexXTURBOXx/catcher_2/tree/master/backend
-
+
Note: Remember to add Internet permission in Android Manifest:
@@ -704,12 +706,12 @@ File handler allows to store logs in file. Minimal example:
```dart
main() {
String path = "/storage/emulated/0/log.txt";
- CatcherOptions debugOptions = CatcherOptions(
+ Catcher2Options debugOptions = Catcher2Options(
DialogReportMode(), [FileHandler(File(path), printLogs: true)]);
- CatcherOptions releaseOptions =
- CatcherOptions(DialogReportMode(), [FileHandler(File(path))]);
+ Catcher2Options releaseOptions =
+ Catcher2Options(DialogReportMode(), [FileHandler(File(path))]);
- Catcher(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions);
+ Catcher2(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions);
}
```
@@ -722,13 +724,13 @@ All parameters list:
* printLogs (optional) - enable/disable debug logs
* handleWhenRejected - please look in console handler description
-Example of logging to file in external directory: https://github.com/jhomlala/catcher/blob/master/example/lib/file_example.dart
+Example of logging to file in external directory: https://github.com/ThexXTURBOXx/catcher_2/blob/master/example/lib/file_example.dart
-If you want to get file path with path_provider lib, you need to call Catcher constructor with
-ensureInitialized = true. Then you need to pass your catcher config with updateConfig.
+If you want to get file path with path_provider lib, you need to call Catcher 2 constructor with
+ensureInitialized = true. Then you need to pass your catcher 2 config with updateConfig.
This is required because WidgetBindings ensureInitialized must be called first before accessing
path_provider methods.
-See example here: https://github.com/jhomlala/catcher/blob/master/example/lib/file_example.dart
+See example here: https://github.com/ThexXTURBOXx/catcher_2/blob/master/example/lib/file_example.dart
#### Toast Handler
Toast handler allows to show short message in toast. Minimal example:
@@ -743,7 +745,7 @@ All parameters list:
* handleWhenRejected - please look in console handler description
-
+
#### Sentry Handler
@@ -753,13 +755,13 @@ Sentry.io page and then copy DSN link. Example:
```dart
main() {
- CatcherOptions debugOptions = CatcherOptions(
+ Catcher2Options debugOptions = Catcher2Options(
DialogReportMode(), [SentryHandler(SentryClient("YOUR_DSN_HERE"))]);
- CatcherOptions releaseOptions = CatcherOptions(NotificationReportMode(), [
+ Catcher2Options releaseOptions = Catcher2Options(NotificationReportMode(), [
EmailManualHandler(["recipient@email.com"])
]);
- Catcher(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions);
+ Catcher2(rootWidget: MyApp(), debugConfig: debugOptions, releaseConfig: releaseOptions);
}
```
@@ -768,8 +770,8 @@ All parameters list:
* enableDeviceParameters (optional) - please look in console handler description
* enableApplicationParameters (optional) - please look in console handler description
* enableCustomParameters (optional) - please look in console handler description
-* customEnvironment (optional) - custom environment string, if null, Catcher will generate it
-* customRelease (optional) - custom release string , if null, Catcher will generate it
+* customEnvironment (optional) - custom environment string, if null, Catcher 2 will generate it
+* customRelease (optional) - custom release string , if null, Catcher 2 will generate it
* printLogs (optional) - enable/disable debug logs
#### Slack Handler
@@ -780,11 +782,11 @@ works: https://api.slack.com/incoming-webhooks.
```dart
main() {
- CatcherOptions debugOptions = CatcherOptions(SilentReportMode(), [
+ Catcher2Options debugOptions = Catcher2Options(SilentReportMode(), [
SlackHandler(
"",
- "#catcher",
- username: "CatcherTest",
+ "#catcher2",
+ username: "Catcher2Test",
iconEmoji: ":thinking_face:",
enableDeviceParameters: true,
enableApplicationParameters: true,
@@ -792,13 +794,13 @@ main() {
enableStackTrace: true,
printLogs: true),
]);
- Catcher(rootWidget: MyApp(), debugConfig: debugOptions);
+ Catcher2(rootWidget: MyApp(), debugConfig: debugOptions);
}
```
All parameters list:
* webhookUrl (required) - url of your webhook
-* channel (required) - your channel name (i.e. #catcher)
+* channel (required) - your channel name (i.e. #catcher2)
* username (optional) - name of the integration bot
* iconEmoji (optional) - avatar of the integration bot
* enableDeviceParameters (optional) - please look in console handler description
@@ -814,7 +816,7 @@ works: https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webho
```dart
main() {
- CatcherOptions debugOptions = CatcherOptions(SilentReportMode(), [
+ Catcher2Options debugOptions = Catcher2Options(SilentReportMode(), [
DiscordHandler(
"",
enableDeviceParameters: true,
@@ -824,7 +826,7 @@ main() {
printLogs: true),
]);
- Catcher(rootWidget: MyApp(), debugConfig: debugOptions);
+ Catcher2(rootWidget: MyApp(), debugConfig: debugOptions);
}
```
@@ -843,7 +845,7 @@ Snackbar handler allows to show customized snackbar message.
```dart
void main() {
- CatcherOptions debugOptions = CatcherOptions(DialogReportMode(), [
+ Catcher2Options debugOptions = Catcher2Options(DialogReportMode(), [
SnackbarHandler(
Duration(seconds: 5),
backgroundColor: Colors.green,
@@ -864,7 +866,7 @@ void main() {
),
]);
- Catcher(
+ Catcher2(
runAppFunction: () {
runApp(MyApp());
},
@@ -898,7 +900,7 @@ Crashlytics handler has been removed from core package. You can re-enable it in
Explicit exception report handler map allows you to setup report handler for specific exception. For example if you want to setup Console Handler for FormatException, you can write:
```dart
var explicitMap = {"FormatException": ConsoleHandler()};
-CatcherOptions debugOptions = CatcherOptions(
+Catcher2Options debugOptions = Catcher2Options(
DialogReportMode(),
[
ConsoleHandler(),
@@ -914,7 +916,7 @@ Now if `FormatException` will be caught, then Console Handler will be used. Warn
Same as explicit report handler map, but it's for report mode. Let's say you want to use specific report mode for some exception:
```dart
var explicitReportModesMap = {"FormatException": NotificationReportMode()};
- CatcherOptions debugOptions = CatcherOptions(
+ Catcher2Options debugOptions = Catcher2Options(
DialogReportMode(),
[
ConsoleHandler(),
@@ -923,7 +925,7 @@ Same as explicit report handler map, but it's for report mode. Let's say you wan
],
explicitExceptionReportModesMap: explicitReportModesMap,);
```
-When `FormatException` will be caught, then NotificationReportMode will be used. For other exceptions, Catcher will use DialogReportMode.
+When `FormatException` will be caught, then NotificationReportMode will be used. For other exceptions, Catcher 2 will use DialogReportMode.
@@ -933,10 +935,10 @@ You can add error widget which will replace red screen of death. To add this int
@override
Widget build(BuildContext context) {
return MaterialApp(
- navigatorKey: Catcher.navigatorKey,
+ navigatorKey: Catcher2.navigatorKey,
//********************************************
builder: (BuildContext context, Widget widget) {
- Catcher.addDefaultErrorWidget(
+ Catcher2.addDefaultErrorWidget(
showStacktrace: true,
title: "Custom error title",
description: "Custom error description",
@@ -952,7 +954,7 @@ You can add error widget which will replace red screen of death. To add this int
);
}
```
-You need to add in your MaterialApp or CupertinoApp builder method with ```Catcher.addDefaultErrorWidget()```. This will add error handler for each widget in your app.
+You need to add in your MaterialApp or CupertinoApp builder method with ```Catcher2.addDefaultErrorWidget()```. This will add error handler for each widget in your app.
You can provide optional parameters:
* showStacktrace - show/hide stacktrace
@@ -968,7 +970,7 @@ Error widget will replace your widget if he fails to render. If width of widget