set method

void set(
  1. T value
)

Sets or replaces the stored value.

This clears any previous value and inserts the new one.

Example

final bucket = ThreadLocalStorageBucket<int>(null, Isolate.current);
bucket.set(42);
print(bucket.get()); // 42

Implementation

void set(T value) {
  _storage = value;
}