Skip to content

Ensure frame is scheduled when root widget is attached#40105

Merged
goderbauer merged 3 commits intoflutter:masterfrom
goderbauer:scheduleFrame
Sep 10, 2019
Merged

Ensure frame is scheduled when root widget is attached#40105
goderbauer merged 3 commits intoflutter:masterfrom
goderbauer:scheduleFrame

Conversation

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Sep 9, 2019

Description

After the change in #39535 we were only scheduling the first frame on accident as a side-effect of the warm-up frame (SchedulerBinding. scheduleWarmUpFrame awaits SchedulerBinding.endOfFrame, which implicitly schedules a frame). This PR makes scheduling the frame more explicit right after the root widget is attached (that's the first point in time where the framework can produce a meaningful frame).

Thanks to @brandondiamond for figuring this out and bringing it to my attention.

Related Issues

#39494

Tests

I added the following tests:

  • Verify that attaching a root widget schedules a frame.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (Please read Handling breaking changes). Replace this with a link to the e-mail where you asked for input on this proposed change.
  • No, this is not a breaking change.

@fluttergithubbot fluttergithubbot added the framework flutter/packages/flutter repository. See also f: labels. label Sep 9, 2019
@goderbauer goderbauer marked this pull request as ready for review September 9, 2019 22:11
@goderbauer goderbauer requested a review from Hixie September 9, 2019 22:39
@Hixie
Copy link
Contributor

Hixie commented Sep 10, 2019

LGTM

@goderbauer goderbauer merged commit 3f98fb7 into flutter:master Sep 10, 2019
@goderbauer goderbauer deleted the scheduleFrame branch September 10, 2019 20:26
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Sep 30, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants