nextTick function

Future<void> nextTick([
  1. VoidCallback? callback
])

Defers the execution of a callback until the next event loop iteration.

Implementation

Future<void> nextTick([VoidCallback? callback]) async {
  await Future.delayed(Duration.zero);

  callback?.call();
}