operator []= method

void operator []=(
  1. String key,
  2. Float32List data
)

Implementation

void operator []=(String key, Float32List data) {
  final index = slot.indexOf(key);

  // Ensure that we are only setting new data if the hash has changed.
  final hash = Object.hashAll(data);
  if (_storage[index]?.hash == hash) {
    return;
  }

  // Store the storage at the given slot index.
  _storage[index] = (data: data, hash: hash);

  // Clear the cache.
  recreateResource = true;
}