getRemainingTime static method

Duration? getRemainingTime(
  1. String token
)

Returns remaining time until expiry date.

Implementation

static Duration? getRemainingTime(String token) {
  final expirationDate = getExpirationDate(token);
  if (expirationDate == null) {
    return null;
  }

  return expirationDate.difference(DateTime.now());
}