Start Debugging

flutter

186 posts · Page 2 of 19

2026-11-11 flutterdarttesting

How to call the real path_provider in a Flutter test instead of getting MissingPluginException

flutter test never runs the Dart plugin registrant, so getTemporaryDirectory() hits the MethodChannel default and throws MissingPluginException. On a macOS, Windows or Linux host you can register the host implementation (PathProviderFoundation 2.6.0+ is FFI, not a channel), use a temp-dir PathProviderPlatform fake, or run integration_test on desktop. Checked on Flutter 3.44.8 with path_provider 2.1.6.
2026-11-05 dartflutterasync

Why does Future.delayed or a Timer fire later than the requested Duration in Dart?

A Dart Timer is a promise never to fire early, not a promise to fire on time. The VM truncates the Duration to whole milliseconds, adds one millisecond on purpose, and delivers the timer as an event that waits behind running code and every pending microtask. Measured lateness on Dart 3.12.2, periodic tick skipping, drift in chained delays, the 4 ms browser clamp, and the 30-day delay that fires instantly on the web.
Prev Next