ttlOf method

Duration? ttlOf(
  1. String key
)

Time left before key expires; null when it has no ttl or does not exist.

Implementation

Duration? ttlOf(String key) {
  final int? at = _expiry[key];
  if (at == null || !has(key)) return null;
  return Duration(milliseconds: at - DateTime.now().millisecondsSinceEpoch);
}