updateRowValueOptimistic method

void updateRowValueOptimistic(
  1. String keyPath,
  2. String locale,
  3. dynamic value
)

Implementation

void updateRowValueOptimistic(String keyPath, String locale, dynamic value) {
  _rows = _rows.map((row) {
    if (row.keyPath == keyPath) {
      final newValues = Map<String, dynamic>.from(row.valuesByLocale);
      newValues[locale] = value;
      return row.copyWith(valuesByLocale: newValues);
    }
    return row;
  }).toList();
  notifyListeners();
}