del static method

Future<bool> del({
  1. required String key,
  2. Type type = Type.CRED_TYPE_GENERIC,
})

The del function (user CredDeleteW from wincred.h) deletes a credential from the user's credential set. The credential set used is the one associated with the logon session of the current token. The token must not have the user's SID disabled.

more info and error types https://docs.microsoft.com/en-us/windows/win32/api/wincred/nf-wincred-creddeletew#return-value

FlutterWindowsVault.del(
 // the key (TargetName) value you want to delete
 key: 'password',
 // type: The type of the credential you want to delete.
 // This member cannot be changed after the credential is created. The values are in Type enum.
 // default value is Type.CRED_TYPE_GENERIC.
 // for more about the types => https://docs.microsoft.com/en-us/windows/win32/api/wincred/ns-wincred-credentiala#members
 type: Type.CRED_TYPE_GENERIC,
);
```

Implementation

static Future<bool> del({
  required String key,
  Type type = Type.CRED_TYPE_GENERIC,
}) {
  assert(key.isNotEmpty);
  // assert(type != null);
  return _channel.invokeMethod<bool>('del', {
    'key': key,
    'type': type.index + 1,
  }).then((value) => value ?? false);
}