isExpired method

bool isExpired(
  1. Duration ttl
)

Checks if this cached entry has exceeded the allowed ttl.

Implementation

bool isExpired(Duration ttl) => DateTime.now().difference(createdAt) > ttl;