updateUserAttributes method

Implementation

@override
Future<Map<UserAttributeKey, UpdateUserAttributeResult>> updateUserAttributes(
    {required UpdateUserAttributesRequest request}) async {
  for (var attribute in request.attributes) {
    _checkUserAttributeKey(attribute.userAttributeKey);
  }
  try {
    final Map<String, dynamic>? data =
        await _channel.invokeMapMethod<String, dynamic>(
      'updateUserAttributes',
      <String, dynamic>{
        'data': request.serializeAsMap(),
      },
    );
    if (data == null) {
      throw AmplifyException(
          AmplifyExceptionMessages.nullReturnedFromMethodChannel);
    }
    return _formatUpdateUserAttributesResponse(data);
  } on PlatformException catch (e) {
    throw castAndReturnPlatformException(e);
  }
}