nextFrame method

Future<void> nextFrame()

Waits for the next frame to build.

Implementation

Future<void> nextFrame() {
  final completer = Completer<void>();
  SchedulerBinding.instance.addPostFrameCallback((_) => completer.complete());
  return completer.future;
}