addDefaultErrorWidget static method

void addDefaultErrorWidget({
  1. bool showStacktrace = true,
  2. String title = "An application error has occurred",
  3. String description = "There was unexpected situation in application. Application has been " "able to recover from error state.",
  4. double maxWidthForSmallMode = 150,
})

Add default error widget which replaces red screen of death (RSOD).

Implementation

static void addDefaultErrorWidget({
  bool showStacktrace = true,
  String title = "An application error has occurred",
  String description =
      "There was unexpected situation in application. Application has been "
          "able to recover from error state.",
  double maxWidthForSmallMode = 150,
}) {
  ErrorWidget.builder = (FlutterErrorDetails details) {
    return CatcherErrorWidget(
      details: details,
      showStacktrace: showStacktrace,
      title: title,
      description: description,
      maxWidthForSmallMode: maxWidthForSmallMode,
    );
  };
}