putItem method

MapInput<K, V, E> putItem(
  1. K key,
  2. V item
)

Inserts or replaces the entry at key with item, runs valueSanitizers on the item, and marks the input as touched.

Implementation

MapInput<K, V, E> putItem(K key, V item) {
  final sanitized = SanitizerPipeline.sanitize(item, valueSanitizers);
  final newMap = Map<K, V>.of(value)..[key] = sanitized;
  return update(value: newMap, status: InputStatus.touched);
}