ErrorWidget constructor

ErrorWidget(
  1. Object exception
)

Creates a widget that displays the given exception.

The message will be the stringification of the given exception, unless computing that value itself throws an exception, in which case it will be the string "Error".

If this object is inspected from an IDE or the devtools, and the original exception is a FlutterError object, the original exception itself will be shown in the inspection output.

Implementation

ErrorWidget(Object exception)
  : message = _stringify(exception),
    _flutterError = exception is FlutterError ? exception : null,
    super(key: UniqueKey());