remove method

Contact remove(
  1. String publicKey
)

Removes a Contact specified by publicKey from the ContactList and returns the removed Contact.

An ArgumentError is thrown if publicKey is unknown.

Implementation

Contact remove(String publicKey) {
  if (!_contacts.containsKey(publicKey)) {
    throw ArgumentError.value(publicKey, 'publicKey', "Unknown contact");
  }
  return _contacts.remove(publicKey) as Contact;
}