waitingBeatDue function
Whether a still waiting heartbeat beat is due now (issue #450):
cadence must be enabled and lastHeartbeat plus heartbeatMin must
have passed. Pure — unit-tested directly.
Implementation
bool waitingBeatDue({
required DateTime now,
required DateTime lastHeartbeat,
required int heartbeatMin,
}) {
if (heartbeatMin <= 0) return false;
return !now.isBefore(lastHeartbeat.add(Duration(minutes: heartbeatMin)));
}