toJsonMap static method

Map toJsonMap(
  1. Token? model
)

Implementation

static Map toJsonMap(Token? model) {
  Map ret = {};
  if (model != null) {
    if (model.accessToken != null) {
      ret['access_token'] = model.accessToken;
    }
    if (model.idToken != null) {
      ret['id_token'] = model.idToken;
    }
    if (model.tokenType != null) {
      ret['token_type'] = model.tokenType;
    }
    if (model.refreshToken != null) {
      ret['refresh_token'] = model.refreshToken;
    }
    if (model.expiresIn != null) {
      ret['expires_in'] = model.expiresIn;
    }
    if (model.expireTimeStamp != null) {
      ret['expire_timestamp'] = model.expireTimeStamp!.millisecondsSinceEpoch;
    }
  }
  return ret;
}