enablePointerInteraction property
Used to allow or restrict the interaction of TimeRegion.
Note: This property only restrict the interaction on region and it does not restrict the following
- Programmatic selection(if user update the selected date value dynamically)
- Does not clear the selection when user select the region and dynamically change the enablePointerInteraction property to false.
- It does not restrict appointment interaction when the appointment placed in the region.
- It does not restrict the appointment rendering on specified region
See also:
- SfCalendar.onTap, the callback which notifies when the calendar element tapped on view.
- SfCalendar.onLongPress, the callback which notifies when the calendar element long pressed on view.
- Knowledge base: How to add a special region dynamically using onTap and onViewChanged
- Knowledge base: How to highlight the weekends
- Knowledge base: How to highlight the lunch hours
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),
text: 'Break'));
return regions;
}
Implementation
final bool enablePointerInteraction;