addTask static method
- String barcode, {
- required LocalDatabase localDatabase,
- 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);
}