GridPainter constructor

GridPainter({
  1. required List<String> headers,
  2. required Map<String, List<GridImage>> map,
  3. required BuildContext context,
  4. required int crossAxisCount,
  5. required FilterQuality filterQuality,
  6. required double padding,
  7. required ScrollController scrollController,
  8. required double blinkVal,
  9. required String clickedItemId,
  10. double headerFontSize = 14,
  11. required Color headerColor,
  12. required Color headerTextColor,
  13. required Color backgroundColor,
  14. required OnCanvasChanged onCanvasChanged,
})

Implementation

GridPainter({required this.headers,
  required this.map,
  required this.context,
  required this.crossAxisCount,
  required this.filterQuality,
  required this.padding,
  required this.scrollController,
  required this.blinkVal,
  required this.clickedItemId,
  this.headerFontSize = 14,
  required this.headerColor,
  required this.headerTextColor,
  required this.backgroundColor,
  required this.onCanvasChanged}) {
  painter = Paint()
    ..strokeWidth = 1
    ..style = PaintingStyle.fill
    ..filterQuality = filterQuality;
  textPainter = TextPainter();
  textPainter.textDirection = TextDirection.ltr;
  for (var header in headers) {
    headerSpans.add(TextSpan(
        text: header, style: TextStyle(fontSize: headerFontSize, color: headerTextColor)));
  }
  boxSize = MediaQuery
      .of(context)
      .size
      .width / crossAxisCount;
  headerSize = boxSize * 0.5;
}