size property

int? get size

Gets or sets the size of the cache entry value.

The size is an arbitrary value defined by the application. When set, the cache will enforce the MemoryCacheOptions.sizeLimit and remove entries when the total size exceeds the limit.

Implementation

int? get size => _size;
set size (int? value)

Implementation

set size(int? value) {
  if (value != null && value < 0) {
    throw ArgumentError.value(
      value,
      'size',
      'The size value must be non-negative.',
    );
  }
  _size = value;
}