queryProductDetails method

Future<ProductDetailsResponseWrapper> queryProductDetails({
  1. required List<ProductWrapper> productList,
})

Returns a list of ProductDetailsResponseWrappers that have ProductDetailsWrapper.productId and ProductDetailsWrapper.productType in productList.

Calls through to `BillingClient#queryProductDetailsAsync(QueryProductDetailsParams, ProductDetailsResponseListener)`(https://developer.android.com/reference/com/android/billingclient/api/BillingClient#queryProductDetailsAsync(com.android.billingclient.api.QueryProductDetailsParams,%20com.android.billingclient.api.ProductDetailsResponseListener). Instead of taking a callback parameter, it returns a Future ProductDetailsResponseWrapper. It also takes the values of ProductDetailsParams as direct arguments instead of requiring it constructed and passed in as a class.

Implementation

Future<ProductDetailsResponseWrapper> queryProductDetails({
  required List<ProductWrapper> productList,
}) async {
  return productDetailsResponseWrapperFromPlatform(
      await _hostApi.queryProductDetailsAsync(productList
          .map((ProductWrapper product) =>
              platformQueryProductFromWrapper(product))
          .toList()));
}