Skip to content

FutureBuilder with Router may freeze on showDialog #115887

@jjmerino

Description

@jjmerino

Internal bug: b/260148546

Hello,
We are showing a dialog after Navigation. We recently migrated to the Navigator 2.0 api (pages passed by a router delegate), and our dialogs broke:

  • When popping the dialog from Navigator.pop(context), it may get stuck.
    and require the app to restart. Suspending and resuming is not enough.
  • The attached app is able to reproduce the problem by creating a tree of the form:
    [FutureBuilder] -> [Navigator] > [showDialog]

Seems reproducible under two conditions. (There may be more):

  • A) Building the navigator pages under a FutureBuilder. This builds the
    Navigator multiple times with a "different" List that contains the same
    elements. Navigator checks "pages != oldPages" and the dialog gets
    removed.
    This isn't surprising if the dialog was considered part of the
    prior Paged route, but it is surprising that the overlay remains stuck.
  • B) The route is replacing a previous page.

See the attached app here:

https://dartpad.dev/?id=fe55c717f2c144936493f0fb49802289

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressioncustomer: trends (g3)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