thumbnailKey function

String thumbnailKey(
  1. PdfEditingController controller,
  2. int pageIndex,
  3. Color pageColor,
  4. bool annotations,
  5. int pixelWidth,
)

The shared-cache key a page's thumbnail is stored under: page index, its render stamp (so an edit re-renders only the pages it touched), the paper color, the raster width bucket, and whether annotations are drawn. The tile, the grid cell, and the background warm all derive the same key, so they reuse one another's rasters.

Implementation

String thumbnailKey(PdfEditingController controller, int pageIndex,
        Color pageColor, bool annotations, int pixelWidth) =>
    '$pageIndex|${controller.pageRenderStamp(pageIndex)}'
    '|${pageColor.toARGB32()}|$pixelWidth${annotations ? '' : '|noannots'}';