timeRegionBuilder property

TimeRegionBuilder? timeRegionBuilder

A builder that builds a widget that replaces the time region view in day, week, workweek, and timeline day, week, workweek views.

See also:

List<TimeRegion> _getTimeRegions() {
   final List<TimeRegion> regions = <TimeRegion>[];
   DateTime date = DateTime.now();
   date = DateTime(date.year, date.month, date.day, 12, 0, 0);
       startTime: date,
       endTime: date.add(Duration(hours: 2)),
       enablePointerInteraction: false,
       color: Colors.grey.withOpacity(0.2),
       text: 'Break'));

   return regions;

 Widget build(BuildContext context) {
   return MaterialApp(
       home: Scaffold(
     body: SfCalendar(
       view: CalendarView.day,
       specialRegions: _getTimeRegions(),
           (BuildContext context, TimeRegionDetails timeRegionDetails) {
         return Container(
           margin: EdgeInsets.all(1),
           alignment: Alignment.center,
           child: Text(
             style: TextStyle(color: Colors.black),
           decoration: BoxDecoration(
               shape: BoxShape.rectangle,
               borderRadius: BorderRadius.all(Radius.circular(4.0)),
               gradient: LinearGradient(
                   colors: [timeRegionDetails.region.color!, Colors.cyan],
                   begin: Alignment.centerRight,
                   end: Alignment.centerLeft)),


final TimeRegionBuilder? timeRegionBuilder;