list static method

Future<List<Cred>> list({
  1. String? filter,
})

The list function (uses CredEnumerateW from wincred.h) enumerates the credentials 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-credenumeratew#return-value

// filter: string that contains the filter for the returned credentials. Only credentials with a TargetName matching the filter will be returned.
// The filter specifies a name prefix followed by an asterisk. For instance, the filter "FRED*" will return all credentials with a TargetName beginning with the string "FRED".
FlutterWindowsVault.list(filter: '*');

Implementation

static Future<List<Cred>> list({String? filter}) {
  return _channel.invokeListMethod(
      'list', {'filter': filter}).then<List<Cred>>((values) {
    // print(values);
    return List.from(values ?? [])
        .where((e) => e is Map)
        .map((e) => Map<String, dynamic>.from(e))
        .map<Cred>((cred) {
      return Cred.fromJson(cred);
    }).toList();
  });
}