timeZone property
Used to specify the time zone of TimeRegion start and end time.
See also:
- endTime, the date time value in which the time region will end.
- startTime, the date time value in which the time region will start.
- SfCalendar.timeZone, to set the timezone for the calendar.
- The documentation for time zone
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,
timeZone: 'Eastern Standard Time',
color: Colors.grey.withOpacity(0.2),
text: 'Break'));
return regions;
}
Implementation
final String? timeZone;