isAllDay property
Displays the Appointment on the all day panel area of time slot views in SfCalendar.
An Appointment rendered between the given startTime and endTime in the time slots of the time slot view in SfCalendar by default.
If it is set as true
the appointment's startTime and endTime will be
ignored and the appointment will be rendered on the all day panel area of
the time slot views.
Defaults to false
.
See also:
- CalendarDataSource.isAllDay, which maps the custom business objects corresponding property to this property.
- startTime, the date time value in which the appointment will start.
- endTime, the date time value in which the appointment will end
- startTimeZone, the timezone for the start time, the appointment will render by converting the start time based on the startTimeZone, and SfCalendar.timeZone.
- endTimeZone, the timezone for the start time, the appointment will render by converting the end time based on the endTimeZone, and SfCalendar.timeZone.
- SfCalendar.timeZone, to set the timezone for the calendar.
- The documentation for time zone
Widget build(BuildContext context) {
return Container(
child: SfCalendar(
view: CalendarView.day,
dataSource: _getCalendarDataSource(),
),
);
}
class DataSource extends CalendarDataSource {
DataSource(List<Appointment> source) {
appointments = source;
}
}
DataSource _getCalendarDataSource() {
List<Appointment> appointments = <Appointment>[];
appointments.add(
Appointment(
startTime: DateTime.now(),
endTime: DateTime.now().add(
Duration(hours: 2)),
isAllDay: true,
subject: 'Meeting',
color: Colors.blue,
startTimeZone: '',
endTimeZone: ''
));
return DataSource(appointments);
}
Implementation
bool isAllDay;