Skip to content

Commit 615568d

Browse files
committed
v1.5.0
1 parent 2f82da4 commit 615568d

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [1.5.0] - 2024-06-10
2+
3+
* Add `errorWidget` to ErrorStack init method. This allows you to set a custom error widget to be displayed when an error occurs in production.
4+
15
## [1.4.0] - 2024-06-05
26

37
* Update debug and release widget to support responsive design.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Once you have added Error Stack to your application, it will override the defaul
4646
- [x] Search fix for error via Google
4747
- [x] Modern UI for debug and release mode
4848
- [x] Light and Dark mode support
49+
- [x] Customizable Production Error Page
4950

5051
## Getting started
5152

@@ -55,7 +56,7 @@ Add the following to your `pubspec.yaml` file:
5556

5657
``` yaml
5758
dependencies:
58-
error_stack: ^1.4.0
59+
error_stack: ^1.5.0
5960
```
6061
6162
or with Dart:

lib/error_stack.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,21 @@ class ErrorStack {
3434
/// Initialize the ErrorStack package
3535
/// You can set the [level] to [ErrorStackLogLevel.verbose] to see more details
3636
/// You can set the [initialRoute] to the route you want to navigate to when an error occurs
37+
/// You can set the [errorWidget] to a custom error widget
3738
static init({
3839
ErrorStackLogLevel level = ErrorStackLogLevel.minimal,
3940
String initialRoute = "/",
41+
Widget Function(FlutterErrorDetails errorDetails)? errorWidget,
4042
}) async {
4143
ErrorStack.instance.initialRoute = initialRoute;
4244
ErrorStack.instance.themeMode = await ErrorStack.instance.storage
4345
.read(key: '${ErrorStack.storageKey}_theme_mode') ??
4446
'light';
4547
ErrorWidget.builder = (FlutterErrorDetails errorDetails) {
4648
if (kReleaseMode) {
49+
if (errorWidget != null) {
50+
return errorWidget(errorDetails);
51+
}
4752
return ErrorStackReleaseWidget(errorDetails: errorDetails);
4853
}
4954
return ErrorStackDebugWidget(errorDetails: errorDetails);

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: error_stack
22
description: "ErrorStack helps you swiftly deal with errors in your Flutter applications! Custom error handling UI and logging to keep you productive."
3-
version: 1.4.0
3+
version: 1.5.0
44
homepage: https://nylo.dev
55
repository: https://github.com/nylo-core/error-stack/tree/1.x
66
issue_tracker: https://github.com/nylo-core/error-stack/issues

0 commit comments

Comments
 (0)