addTask static method

Future<void> addTask(
  1. String barcode, {
  2. required LocalDatabase localDatabase,
  3. required ProductType productType,
})

Adds the background task about refreshing the product later.

Implementation

static Future<void> addTask(
  String barcode, {
  required LocalDatabase localDatabase,
  required ProductType productType,
}) async {
  final String uniqueId = await _operationType.getNewKey(
    localDatabase,
    barcode: barcode,
  );
  final BackgroundTaskBarcode task = _getNewTask(
    barcode,
    uniqueId,
    productType,
  );
  await task.addToManager(localDatabase, queue: BackgroundTaskQueue.fast);
}