isValid method

bool isValid()

Implementation

bool isValid() {
  if (expiresAt.isEmpty || expiresAt == 'no token') return false;
  bool timeValid = Clock.now().isBefore(
      DateTime.fromMillisecondsSinceEpoch(int.parse(expiresAt) * 1000));
  bool tokenExist = accessToken.isNotEmpty && accessToken != 'no token';
  return timeValid && tokenExist;
}