GridPainter constructor
GridPainter({
- required List<
String> headers, - required Map<
String, List< map,GridImage> > - required BuildContext context,
- required int crossAxisCount,
- required FilterQuality filterQuality,
- required double padding,
- required ScrollController scrollController,
- required double blinkVal,
- required String clickedItemId,
- double headerFontSize = 14,
- required Color headerColor,
- required Color headerTextColor,
- required Color backgroundColor,
- 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;
}