getAllAuthCredentials method
Gets a map list of all HTTP auth credentials saved.
Each map contains the key protectionSpace
of type URLProtectionSpace
and the key credentials
of type List<URLCredential
> that contains all the HTTP auth credentials saved for that protectionSpace
.
Officially Supported Platforms/Implementations:
- Android native WebView
- iOS (Official API - URLCredentialStorage.allCredentials)
- MacOS (Official API - URLCredentialStorage.allCredentials)
Implementation
@override
Future<List<URLProtectionSpaceHttpAuthCredentials>>
getAllAuthCredentials() async {
Map<String, dynamic> args = <String, dynamic>{};
List<dynamic> allCredentials =
await channel?.invokeMethod<List>('getAllAuthCredentials', args) ?? [];
List<URLProtectionSpaceHttpAuthCredentials> result = [];
for (Map<dynamic, dynamic> map in allCredentials) {
var element = URLProtectionSpaceHttpAuthCredentials.fromMap(
map.cast<String, dynamic>());
if (element != null) {
result.add(element);
}
}
return result;
}