Skip to content

Commit 1cb912e

Browse files
Make the application lifecycle does not affect SchedulerBinding.scheduleForcedFrame. (#97468)
1 parent ce5fdff commit 1cb912e

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

packages/flutter/lib/src/scheduler/binding.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -818,11 +818,6 @@ mixin SchedulerBinding on BindingBase {
818818
/// Consider using [scheduleWarmUpFrame] instead if the goal is to update the
819819
/// rendering as soon as possible (e.g. at application startup).
820820
void scheduleForcedFrame() {
821-
// TODO(chunhtai): Removes the if case once the issue is fixed
822-
// https://github.com/flutter/flutter/issues/45131
823-
if (!framesEnabled)
824-
return;
825-
826821
if (_hasScheduledFrame)
827822
return;
828823
assert(() {

packages/flutter/test/widgets/binding_test.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,9 @@ void main() {
177177
tester.binding.scheduleFrame();
178178
expect(tester.binding.hasScheduledFrame, isFalse);
179179

180-
// TODO(chunhtai): fix this test after workaround is removed
181-
// https://github.com/flutter/flutter/issues/45131
182180
tester.binding.scheduleForcedFrame();
183-
expect(tester.binding.hasScheduledFrame, isFalse);
181+
expect(tester.binding.hasScheduledFrame, isTrue);
182+
await tester.pump();
184183

185184
int frameCount = 0;
186185
tester.binding.addPostFrameCallback((Duration duration) {

0 commit comments

Comments
 (0)