getExpirationDate static method

DateTime getExpirationDate(
  1. String token
)

Returns token expiration date

Implementation

static DateTime getExpirationDate(String token) {
  final decodedToken = decode(token)!;

  final expirationDate = DateTime.fromMillisecondsSinceEpoch(0)
      .add(Duration(seconds: decodedToken['exp'].toInt()));
  return expirationDate;
}