daysBetweenRenewals method
Gets the number of days between the last renewal and the next one. In the
case of monthly renewal, the value returned depends on the month in which
from
date is. If from
is not provided, DateTime.now()
date is taken,
as it is for lastRenewal()
and nextRenewal
methods.
Implementation
int daysBetweenRenewals({
DateTime? from,
}) {
from ??= DateTime.now();
return nextRenewal(from: from).difference(lastRenewal(from: from)).inDays;
}