storeCredential method
Future<Result>
storeCredential(
- PasswordCredential credential, {
- Mediation mediation = Mediation.Optional,
store Password Credential
mediation: default is Mediation.Optional. This is ignored in Web. return: Result enum value. This is always Result.Unknown in Web Platform. throws ArgumentError: id or password is empty
Implementation
Future<Result> storeCredential(PasswordCredential credential,
{Mediation mediation = Mediation.Optional}) async {
if (credential.id!.isEmpty) {
throw ArgumentError.value(credential, "id cannot be empty");
}
if (credential.password!.isEmpty) {
throw ArgumentError.value(credential, "password cannot be empty");
}
var result = await _channel.invokeMethod("store", <String, dynamic>{
"credential": jsonEncode(credential),
"mediation": mediation.string
});
return resultFrom(result);
}