remove method

Future<bool> remove(
  1. String id
)

Removes a queued operation by ID and reports whether it existed.

Implementation

Future<bool> remove(String id) {
  return _runSerial<bool>(() async {
    _ensureReady();
    final queue = await _store.readAll();
    final remaining = queue.where((item) => item.id != id).toList();
    if (remaining.length == queue.length) {
      return false;
    }
    await _store.writeAll(remaining);
    return true;
  });
}