invokeRequest<TOptions extends RequestOptions> method
Future<Map<String, dynamic> >
invokeRequest<TOptions extends RequestOptions>({
- required String method,
- required WebAuthRequest<
TOptions> request, - bool? throwOnNull = true,
Implementation
Future<Map<String, dynamic>> invokeRequest<TOptions extends RequestOptions>({
required final String method,
required final WebAuthRequest<TOptions> request,
final bool? throwOnNull = true,
}) async {
final Map<String, dynamic>? result;
try {
result = await _channel.invokeMapMethod(method, request.toMap());
} on PlatformException catch (e) {
throw WebAuthenticationException.fromPlatformException(e);
}
if (result == null && throwOnNull == true) {
throw const WebAuthenticationException.unknown('Channel returned null.');
}
return result ?? {};
}