onBuildError property
Reports an exception thrown by an element's build, and returns the widget that element shows instead. So is one a component element's child threw while it was updated (see ComponentElement.performRebuild) and one a rebuild threw past that (a state's didChangeDependencies, an updateRenderObject when a dependency changed): reported for the element that threw it, the nearest component element or LayoutBuilder at or above it shows the widget in place of its child. An element whose builds go on throwing an error of the same type and text is reported once: it shows the widget again until it builds, or throws another. Unset, a build's exception goes to the current Zone's error handler and the element shows an empty render object; the others go out of buildScope.
Implementation
final Widget Function(Element element, Object error, StackTrace stack)?
onBuildError;