maximumSizeBytes property

int maximumSizeBytes

Maximum size of entries to store in the cache in bytes.

Once more than this amount of bytes have been cached, the least-recently-used entry is evicted until there are fewer than the maximum bytes.


int get maximumSizeBytes => _maximumSizeBytes;
void maximumSizeBytes=(int value)

Changes the maximum cache bytes.

If the new size is smaller than the current size in bytes, the extraneous elements are evicted immediately. Setting this to zero and then returning it to its original value will therefore immediately clear the cache.


set maximumSizeBytes(int value) {
  assert(value >= 0);
  if (value == _maximumSizeBytes) {
  TimelineTask? debugTimelineTask;
  if (!kReleaseMode) {
    debugTimelineTask = TimelineTask()..start(
      arguments: <String, dynamic>{'value': value},
  _maximumSizeBytes = value;
  if (_maximumSizeBytes == 0) {
  } else {
  if (!kReleaseMode) {