iconData property
Used to specify the icon of TimeRegion.
Note: If time region have both the text and icon then it will draw icon only.
See also:
- text, the string which will be displayed on the time region view.
- textStyle, which used to customize the style of the text on the time region view.
- Knowledge base: How to highlight the weekends
- Knowledge base: How to highlight the lunch hours
- Knowledge base: How to add a special region dynamically using onTap and onViewChanged
Widget build(BuildContext context) {
return Container(
child: SfCalendar(
view: CalendarView.week,
specialRegions: _getTimeRegions(),
),
);
}
List<TimeRegion> _getTimeRegions() {
final List<TimeRegion> regions = <TimeRegion>[];
regions.add(TimeRegion(
startTime: DateTime.now(),
endTime: DateTime.now().add(Duration(hours: 1)),
enablePointerInteraction: false,
color: Colors.grey.withOpacity(0.2),
iconData: Icons.free_breakfast));
return regions;
}
Implementation
final IconData? iconData;