Skip to content

State Restoration: Provide better error message if initial routes produced by onGenerateInitialRoutes are not restorable #72453

@goderbauer

Description

@goderbauer

When a Navigator is configured with a RestorationId, and all routes returned by onGenerateInitialRoutes are not restorable, a cryptic error is thrown, see https://github.com/flutter/gallery/pull/389/files#r544521147 and the original comment. We should throw a better error telling developers that the routes returned by onGenerateInitialRoutes should be made restorable by giving them a settings.name that can be looked up in the routes table during restoration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: error messageError messages from the Flutter frameworka: state restorationRestorationManager and related APIsc: tech-debtTechnical debt, code quality, testing, etc.f: routesNavigator, Router, and related APIs.frameworkflutter/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