async_error_boundary 0.1.0
async_error_boundary: ^0.1.0 copied to clipboard
Declarative error boundary widget for Flutter inspired by React's Error Boundary. Catch errors thrown by descendants and render fallback UI with reset support.
0.1.0 #
Initial release.
Features #
ErrorBoundarywidget that catches errors thrown during the build of its descendants and renders abuilder(context, error, reset)fallback, inspired by React's Error Boundary.onErrorcallback for logging or reporting caught errors with the original stack trace.onResetcallback that fires when the boundary is reset, receiving an optional argument forwarded from the fallback's reset function.resetKeysfor automatic recovery: when any value in the list changes between rebuilds, the error state is cleared andonResetis invoked withnull, mirroringreact-error-boundarysemantics.ErrorBoundary.of(context)returns anErrorBoundaryProviderexposingresetBoundaryandshowBoundaryfor imperative control from descendant widgets.ErrorBoundaryStateandErrorFallbackBuildertypedefs for consumers that want to spell out the boundary's state shape or build their own fallbacks.
Documentation #
- Bilingual README (English / Japanese) with usage examples covering the builder fallback,
onError/onReset,resetKeys, and nested boundaries.