Skip to content

[go_router] Improve error API #108144

@johnpryan

Description

@johnpryan

Right now there's two parameters for handling errors, errorPageBuilder and errorBuilder. Users might prefer to handle the exception programmatically and navigate to an app location rather than by building a widget for the error screen. For example, we could provide an API that takes a callback:

GoRouter(
  onError: (Exception e) {
    // Handle the error...
    return '/home?dialogMessage="Page not found."';
  }

Metadata

Metadata

Assignees

Labels

P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Flutterp: go_routerThe go_router packagepackageflutter/packages repository. See also p: labels.

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions