account method

Future account(
  1. String userId,
  2. String scheme,
  3. String secret,
  4. bool login,
  5. AccountParams? params,
)

Create or update an account

Implementation

Future account(String userId, String scheme, String secret, bool login,
    AccountParams? params) {
  Packet? packet = _packetGenerator.generate(packet_types.Acc, null);
  var data = packet.data as AccPacketData;
  data.user = userId;
  data.login = login;
  data.scheme = scheme;
  data.secret = secret;

  if (params != null) {
    data.tags = params.tags;
    data.cred = params.cred;
    data.token = params.token;

    data.desc = {};
    data.desc!['defacs'] = params.defacs;
    data.desc!['public'] = params.public;
    data.desc!['private'] = params.private;
  }
  packet.data = data;
  return _send(packet);
}