Skip to content

ExceptionHandler Widget #19993

@escamoteur

Description

@escamoteur

@eseidelGoogle As discussed here is the issue:

Currently we don't have a possibility to handle Exceptions that happens inside a Widget somewhere down the widget tree. I would propose a Widget that allows that. Something like

typedef ExceptionHandler = void Function( ex)
typedef AlternativeBuilder = void Function(BuildingContext context, ex)


ExceptionHandledBuilder(
   List<Object>  exceptionsToCatch,           // Exceptions that should behandled  (It's really a pity that Dart doesen't have a common Exception base class)
   HandlerFunction: onException,               // get's called to allow logging or what else
   AlternativeBuilder: alternativeBuilder,     // Builder that get's invoked while executing the normal builder method
   AsyncWidgetBuilder<T>: builder);          // the default builder that tryies to bild the child widget tree.

I'm not sure if something like this is possible.

What are your thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: new featureNothing broken; request for a new capabilityframeworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions