Skip to content

[PageTransitionsBuilder] ZoomPageTransition causing widget rebuild three times #58345

@AlexV525

Description

@AlexV525

There's a reproducible demo, try it with https://dartpad.cn/fb30323847b7e0aee6c61bdbecacd060 . It happens on all platforms.

Steps to Reproduce

  1. Create a PageRouteBuilder with _ZoomPageTransition.
  2. Add log to build method inside new page.
  3. Log printed 3 times total.

Expected results: Build only once.

Actual results: Widget built 3 times.

Logs
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.363
I/flutter ( 7614): State's hashCode: 48367006
I/flutter ( 7614): build: 2020-05-31 12:33:48.365
I/flutter ( 7614): built times: 0
I/flutter ( 7614): built times: 1
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.414
I/flutter ( 7614): State's hashCode: 48367006
I/flutter ( 7614): build: 2020-05-31 12:33:48.422
I/flutter ( 7614): built times: 1
I/flutter ( 7614): built times: 2
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.454
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.467
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.480
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.494
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.507
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.521
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.534
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.548
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.564
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.588
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.602
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.615
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.628
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.643
I/flutter ( 7614): build transition: 2020-05-31 12:33:48.660
I/flutter ( 7614): State's hashCode: 48367006
I/flutter ( 7614): build: 2020-05-31 12:33:48.664
I/flutter ( 7614): built times: 2
I/flutter ( 7614): built times: 3

flutter doctor

[√] Flutter (Channel stable, v1.17.2, on Microsoft Windows [Version 10.0.18363.836], locale zh-CN)

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.f: routesNavigator, Router, and related APIs.found in release: 1.19Found to occur in 1.19frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work on

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions