canShow property

bool get canShow

Whether enough time has elapsed since the last impression.

Returns true if:

  • No ad has been shown yet
  • The interval has elapsed
  • Frequency capping is disabled (intervalSeconds == 0)

Implementation

bool get canShow {
  if (intervalSeconds <= 0) return true;
  final last = _lastShowTime;
  if (last == null) return true;
  return DateTime.now().difference(last).inSeconds >= intervalSeconds;
}