Skip to content

Commit

Permalink
Make the application lifecycle does not affect `SchedulerBinding.sche…
Browse files Browse the repository at this point in the history
…duleForcedFrame`. (#97468)
  • Loading branch information
ColdPaleLight authored Feb 5, 2022
1 parent ce5fdff commit 1cb912e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 0 additions & 5 deletions packages/flutter/lib/src/scheduler/binding.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(() {
Expand Down
5 changes: 2 additions & 3 deletions packages/flutter/test/widgets/binding_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1cb912e

Please sign in to comment.