Skip to content

Remove unnecessary Future.delayed() from SideMenu.dispose()#83

Open
gradycsjohnson wants to merge 1 commit intoJamalianpour:masterfrom
gradycsjohnson:fix-timer-still-pending-error
Open

Remove unnecessary Future.delayed() from SideMenu.dispose()#83
gradycsjohnson wants to merge 1 commit intoJamalianpour:masterfrom
gradycsjohnson:fix-timer-still-pending-error

Conversation

@gradycsjohnson
Copy link

It seems to be unnecessary to call Future.delayed() inside the SideMenu.dispose() method, and doing so causes async tests to fail with the timer still pending error:

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test:
A Timer is still pending even after the widget tree was disposed.
'package:flutter_test/src/binding.dart':
Failed assertion: line 1527 pos 12: '!timersPending'

When the exception was thrown, this was the stack:
#2      AutomatedTestWidgetsFlutterBinding._verifyInvariants (package:flutter_test/src/binding.dart:1527:12)
#3      TestWidgetsFlutterBinding._runTestBody (package:flutter_test/src/binding.dart:1034:7)

Removing solves this problem without seeming to cause any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant