needsRefresh method

bool needsRefresh(
  1. int? latestTimestamp,
  2. List<String> barcodes
)

Returns true if at least one barcode was refreshed after the timestamp.

Implementation

bool needsRefresh(int? latestTimestamp, List<String> barcodes) {
  if (latestTimestamp == null) {
    // no need to "refresh", need to start instead!
    return false;
  }
  for (final String barcode in barcodes) {
    final int? timestamp = _timestamps[barcode];
    if (timestamp != null && timestamp > latestTimestamp) {
      return true;
    }
  }
  return false;
}