getCredentials static method
Get all current credentials for this device.
Returns a List of Credentials
Implementation
static Future<List<Credential>> getCredentials() async {
List<dynamic>? credentialListMap =
await _channel.invokeListMethod("getCredentials");
List<Credential> credentialList = List.empty(growable: true);
if (credentialListMap != null) {
try {
credentialList = credentialListMap
.map((cred) => Credential.mapToCredential(cred))
.toList();
} on Exception {
rethrow;
}
} else {
throw Exception("Error getting credentials from platform");
}
return credentialList;
}