Open
Description
Describe the bug/problem
When running flutter test
, the following errors are encountered:
-
Pending Timer Error
- Exception:
═╡ 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 1606 pos 12: '!timersPending'
- Possible Cause:
A timer remains active after the widget tree has been disposed.
- Exception:
-
Late Initialization Error
- Exception:
═╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═ The following LateError was thrown while finalizing the widget tree: LateInitializationError: Field '_videoController@28198544' has not been initialized.
- Possible Cause:
The_videoController
field is not properly initialized before usage, leading to this error during widget disposal.
- Exception:
Steps to Reproduce the bug/problem
- Open the project in a preferred IDE (e.g., VS Code, Android Studio).
- Run the command:
flutter test
Expected behavior
The tests should pass successfully without encountering Pending Timer or LateInitializationError issues.
Device Info (The device where you encountered this issue)
- OS: Ubuntu 24.04.1 LTS
Additional Notes
- I discussed this with a experienced flutter dev and he concluded that the latetimer error is related to the video_player package (version 2.9.3) Not the project Codebase
- The late initialization error might indicate that _videoController should be initialized earlier in the widget -lifecycle
Metadata
Metadata
Assignees
Labels
No labels