ProductModel constructor

ProductModel(
  1. String barcode,
  2. LocalDatabase localDatabase
)

In the constructor we retrieve async'ly the product from the local db.

Implementation

ProductModel(this.barcode, this.localDatabase) {
  localDatabase.upToDate.showInterest(barcode);
  DaoProductLastAccess(localDatabase).put(barcode);
  _asyncLoad();
}