Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jhomlala authored Jun 15, 2019
1 parent 6795ebf commit 7a188a1
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -725,3 +725,39 @@ CatcherOptions debugOptions = CatcherOptions(
```

Now if `FormatException` will be catched, then Console Handler will be used. Warning: if you setup explicit exception map for specific exception, then only this handler will be used for this exception!

### Error widget
You can add error widget which will replace red screen of death. To add this into your app, see code below:
```dart
@override
Widget build(BuildContext context) {
return MaterialApp(
navigatorKey: Catcher.navigatorKey,
//********************************************
builder: (BuildContext context, Widget widget) {
Catcher.addDefaultErrorWidget(
showStacktrace: true,
customTitle: "Custom error title",
customDescription: "Custom error description");
return widget;
},
//********************************************
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: ChildWidget()),
);
}
```
You can provide optional parameters:
* showStacktrace - show/hide stacktrace
* customTitle - custom title for error widget
* customDescription - custom description for error widget

<p align="center">
<img src="https://raw.githubusercontent.com/jhomlala/catcher/master/screenshots/8.png" width="250px">
</p>



0 comments on commit 7a188a1

Please sign in to comment.