getRemainingTime static method

Duration getRemainingTime(
  1. String token
)

Returns remaining time until expiry date.

Implementation

static Duration getRemainingTime(String token) {
  final expirationDate = getExpirationDate(token);

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