setLatestDownloadedProduct method

void setLatestDownloadedProduct(
  1. Product product, {
  2. bool notify = true,
})

Typical use-case: a product page is refreshed through a pull-gesture.

Implementation

void setLatestDownloadedProduct(
  Product product, {
  bool notify = true,
}) {
  _latestDownloadedProducts[product.barcode!] = product;
  _timestamps[product.barcode!] = LocalDatabase.nowInMillis();
  if (notify) {
    localDatabase.notifyListeners();
  }
}