bulkReviewOptimistic method

void bulkReviewOptimistic(
  1. List<CatalogReviewTarget> targets
)

Implementation

void bulkReviewOptimistic(List<CatalogReviewTarget> targets) {
  for (final target in targets) {
    _rows = _rows.map((row) {
      if (row.keyPath == target.keyPath) {
        final newCellStates = Map<String, CatalogCellState>.from(row.cellStates);
        newCellStates[target.locale] = const CatalogCellState(status: CatalogCellStatus.green);
        final newPendingLocales = row.pendingLocales.where((l) => l != target.locale).toList();
        return row.copyWith(
          cellStates: newCellStates,
          pendingLocales: newPendingLocales,
        );
      }
      return row;
    }).toList();
  }
  notifyListeners();
}