add method

  1. @override
Future<bool> add(
  1. AtContact contact
)

returns true on success otherwise false. has to pass the AtContact to add new contact into the contact_list if atSign value is 'null' then returns false

Implementation

@override
Future<bool> add(AtContact contact) async {
  var atSign = contact.atSign;
  //check if atSign is 'null'
  if (atSign == null) return false;
  var atKey = _formKey(KeyType.contact, key: atSign);
  var json = contact.toJson();
  var value = jsonEncode(json);
  return await atClient!.put(atKey, value);
}