Barcode Pick Async Mapper Product Provider

Defined in library scandit_datacapture_barcode_pick

Note

Barcode Pick is still in beta and may change in future versions of Scandit Data Capture SDK.

BarcodePickAsyncMapperProductProvider
class BarcodePickAsyncMapperProductProvider : BarcodePickProductProvider

Added in version 6.22.0

Usage example:

var products = [
  BarcodePickProduct("780846124122", 2),
  BarcodePickProduct("750865926478", 1),
  BarcodePickProduct("984579832123", 4),
].toSet();

var productProvider = BarcodePickAsyncMapperProductProvider(products, this)

...

@override
void productIdentifierForItems(List<String> itemsData, BarcodePickProductProviderCallback callback) {
  myDb.findAndMapProductsForItemsData(items).then((value) => {
    callback.onData(value);
  });
}

Note

Use your preferred way to retrieve the initial list of products to pick and to handle the async retrieval of products from itemsData. In this snippet we’re using a hardcoded set of products and a fictitious myDb object for simplicity’s sake.

BarcodePickAsyncMapperProductProvider(productsToPick, callback)
BarcodePickAsyncMapperProductProvider(Set<BarcodePickProduct> productsToPick,
        BarcodePickAsyncMapperProductProviderCallback callback)

Added in version 6.22.0

Creates a new instance with the given set of BarcodePickProduct and callback to map items to products asynchronously.