Closed 2e2ee95304418f96 closed 1 year ago
Hi,
As per the shared information, we have checked and your requirement is "Style the trailing and leading dates using cell builder in SfDateRangePicker". We have prepared the simple sample for the same. Please find the sample from the following link.
Sample link: cellbuilder.zip
Also please find the code snippet for the same.
Widget cellBuilder(BuildContext context, DateRangePickerCellDetails details) {
DateTime midDate = details.visibleDates[details.visibleDates.length ~/ 2];
if (details.date.month != midDate.month) {
return Container(
child: Text(details.date.day.toString()),
color: Colors.green,
);
} else {
return Container(
child: Text(details.date.day.toString()),
color: Colors.red,
);
}
}
We hope that this helps you. Please let us know if you need further assistance.
When I use cellBuilder and enable showTrailingAndLeadingDates, but I can't find a way to set the style of TrailingAndLeadingDates.