remove function

bool remove(
  1. String key, {
  2. String? path,
  3. String? domain,
  4. bool? secure,
})

Returns true if the key was found and the value removed. Returns false if the key was not found.

Implementation

bool remove(String key, {String? path, String? domain, bool? secure}) {
  if (get(key) != null) {
    set(
      key,
      '',
      expires: DateTime.fromMillisecondsSinceEpoch(0),
      path: path,
      domain: domain,
      secure: secure,
    );
    return true;
  }
  return false;
}