Make the application lifecycle does not affect SchedulerBinding.scheduleForcedFrame. (#97468)

This commit is contained in:
ColdPaleLight 2022-02-05 09:45:19 +08:00 committed by GitHub
parent ce5fdff8b0
commit 1cb912e75c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 8 deletions

View file

@ -818,11 +818,6 @@ mixin SchedulerBinding on BindingBase {
/// Consider using [scheduleWarmUpFrame] instead if the goal is to update the
/// rendering as soon as possible (e.g. at application startup).
void scheduleForcedFrame() {
// TODO(chunhtai): Removes the if case once the issue is fixed
// https://github.com/flutter/flutter/issues/45131
if (!framesEnabled)
return;
if (_hasScheduledFrame)
return;
assert(() {

View file

@ -177,10 +177,9 @@ void main() {
tester.binding.scheduleFrame();
expect(tester.binding.hasScheduledFrame, isFalse);
// TODO(chunhtai): fix this test after workaround is removed
// https://github.com/flutter/flutter/issues/45131
tester.binding.scheduleForcedFrame();
expect(tester.binding.hasScheduledFrame, isFalse);
expect(tester.binding.hasScheduledFrame, isTrue);
await tester.pump();
int frameCount = 0;
tester.binding.addPostFrameCallback((Duration duration) {