whenExpires method

Future<void> whenExpires()

Returns a Future that completes when the rollover period ends.

This method will delay completion until the remaining time of the current period has elapsed.

Implementation

Future<void> whenExpires() async {
  final remaining = await timeRemaining();
  if (remaining == null || remaining.inMilliseconds == 0) return;
  await Future.delayed(remaining);
}