Description
I'm trying to style the cells in my SfDataGrid with this code:
SfDataGridTheme( data: SfDataGridThemeData( headerStyle: DataGridHeaderCellStyle( backgroundColor: Colors.black54, textStyle: TextStyle( color: Colors.white, fontFamily: 'HNMed', fontSize: 12.sp, ), ), cellStyle: DataGridCellStyle( textStyle: TextStyle( fontFamily: 'HNMed', ), ), ), child: SfDataGrid(....), ),
The above code throws this error:
|I/flutter (12465): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════ I/flutter (12465): The following assertion was thrown during paint(): I/flutter (12465): 'dart:ui/painting.dart': Failed assertion: line 1147: '<optimized out>': is not true. I/flutter (12465): The relevant error-causing widget was: I/flutter (12465): _VirtualizingCellsRenderObjectWidget-[DataRow#88901] I/flutter (12465): file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_datagrid-18.3.38-beta/lib/src/control/cell_control/virtualizing_cells_widget.dart:22:12 I/flutter (12465): When the exception was thrown, this was the stack: I/flutter (12465): #2 Paint.color= (dart:ui/painting.dart:1147:12) I/flutter (12465): #3 _RenderVirtualizingCellsWidget._drawRowBackground (package:syncfusion_flutter_datagrid/src/control/cell_control/virtualizing_cells_widget.dart:204:35) I/flutter (12465): #4 _RenderVirtualizingCellsWidget.paint (package:syncfusion_flutter_datagrid/src/control/cell_control/virtualizing_cells_widget.dart:328:5) I/flutter (12465): #5 RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2311:7)I/flutter (12465): #6 PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:140:11) I/flutter (12465): #7 PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:100:5) I/flutter (12465): #8 PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:978:29) I/flutter (12465): #9 RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:438:19) I/flutter (12465): #10 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:914:13) I/flutter (12465): #11 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:302:5) I/flutter (12465): #12 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1117:15) I/flutter (12465): #13 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1055:9) I/flutter (12465): #14 SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:864:7) I/flutter (12465): (elided 6 frames from class _AssertionError, class _RawReceivePortImpl, class _Timer, and dart:async-patch) I/flutter (12465): The following RenderObject was being processed when the exception was fired: _RenderVirtualizingCellsWidget#b8516: I/flutter (12465): needs compositing I/flutter (12465): creator: _VirtualizingCellsRenderObjectWidget-[DataRow#88901] ← I/flutter (12465): _VirtualizingCellsWidget-[DataRow#88901] ← _VisualContainerRenderObjectWidget ← _VisualContainer ← I/flutter (12465): ConstrainedBox ← _SingleChildViewport ← IgnorePointer-[GlobalKey#50be6] ← Semantics ←I/flutter (12465): _PointerListener ← Listener ← _GestureSemantics ← I/flutter (12465): RawGestureDetector-[LabeledGlobalKey<RawGestureDetectorState>#09b13] ← ⋯ I/flutter (12465): parentData: offset=Offset(0.0, 245.0) (can use size) I/flutter (12465): constraints: BoxConstraints(w=457.1, h=49.0) I/flutter (12465): layer: OffsetLayer#858a2 I/flutter (12465): size: Size(457.1, 49.0) I/flutter (12465): This RenderObject had the following descendants (showing up to depth 5): I/flutter (12465): child 1: _RenderGridCell#8a5c7 I/flutter (12465): child: RenderSemanticsAnnotations#7742b I/flutter (12465): child: RenderSemanticsGestureHandler#cd669 I/flutter (12465): child: RenderPointerListener#7ed6d I/flutter (12465): child: RenderDecoratedBox#ba529 I/flutter (12465): child 2: _RenderGridCell#a982f I/flutter (12465): child: RenderSemanticsAnnotations#1e823 I/flutter (12465): child: RenderSemanticsGestureHandler#1bf4c I/flutter (12465): child: RenderPointerListener#17434 I/flutter (12465): child: RenderDecoratedBox#b0207 I/flutter (12465): child 3: _RenderGridCell#aca11 I/flutter (12465): child: RenderSemanticsAnnotations#157c1 I/flutter (12465): child: RenderSemanticsGestureHandler#73e7d I/flutter (12465): child: RenderPointerListener#d4c76 I/flutter (12465): child: RenderDecoratedBox#4e7ca I/flutter (12465): ════════════════════════════════════════════════════════════════════════════════════════════════════ I/flutter (12465): Another exception was thrown: 'dart:ui/painting.dart': Failed assertion: line 1147: '<optimized out>': is not true. I/flutter (12465): Another exception was thrown: 'dart:ui/painting.dart': Failed assertion: line 1147: '<optimized out>': is not true. I/flutter (12465): Another exception was thrown: 'dart:ui/painting.dart': Failed assertion: line 1147: '<optimized out>': is not true. I/flutter (12465): Another exception was thrown: 'dart:ui/painting.dart': Failed assertion: line 1147: '<optimized out>': is not true. I/flutter (12465): Another exception was thrown: 'dart:ui/painting.dart': Failed assertion: line 1147: '<optimized out>': is not true.
Only when I add a cellStyle
property the exception is thrown. But when I remove the property, it works.