getExpiryDate static method

DateTime? getExpiryDate(
  1. String token
)

Implementation

static DateTime? getExpiryDate(String token) {
  final Map<String, dynamic> payload = parseJwt(token);
  if (payload['exp'] != null) {
    return DateTime.fromMillisecondsSinceEpoch(0, isUtc: true)
        .add(Duration(seconds: payload['exp']));
  }
  return null;
}