blockMainThread static method
Blocks the main thread, where Dart runs too, for duration and at most
30 seconds, so the hang watchdog fires. Completes before the block,
which is posted to the main thread.
Implementation
static Future<void> blockMainThread(Duration duration) => _quietly(
() => RumHostApi().blockMainThread(
duration.inMilliseconds.clamp(0, _maxBlock.inMilliseconds),
),
);