| [](https://pub.dev/packages/syncfusion_flutter_barcodes) | [](https://pub.dev/packages/syncfusion_flutter_barcodes/score) | [](https://pub.dev/packages/syncfusion_flutter_barcodes/score) | [](https://pub.dev/packages/syncfusion_flutter_barcodes/score) |
@@ -116,17 +115,12 @@ Run your application either using `F5` or `Run > Start Debugging`.
Explore the full capabilities of our Flutter widgets on your device by installing our sample browser applications from the below app stores, and view samples code in GitHub.
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
## Useful links
diff --git a/packages/syncfusion_flutter_barcodes/README.md b/packages/syncfusion_flutter_barcodes/README.md
index 141e83ed8..a8166ff66 100644
--- a/packages/syncfusion_flutter_barcodes/README.md
+++ b/packages/syncfusion_flutter_barcodes/README.md
@@ -134,4 +134,4 @@ The following screenshot illustrates the result of the previous code sample.
Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion has more than 20,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies.
-Today we provide 1,000+ controls and frameworks for web ([ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls), [ASP.NET WebForms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), and [Blazor](https://www.syncfusion.com/blazor-components)), mobile ([Xamarin](https://www.syncfusion.com/xamarin-ui-controls), [Flutter](https://www.syncfusion.com/flutter-widgets), [UWP](https://www.syncfusion.com/uwp-ui-controls), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls)), and desktop development ([WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/wpf-ui-controls), and [UWP](https://www.syncfusion.com/uwp-ui-controls)). We provide ready-to- deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.
\ No newline at end of file
+Today we provide 1,000+ controls and frameworks for web ([ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls), [ASP.NET WebForms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), and [Blazor](https://www.syncfusion.com/blazor-components)), mobile ([Xamarin](https://www.syncfusion.com/xamarin-ui-controls), [Flutter](https://www.syncfusion.com/flutter-widgets), [UWP](https://www.syncfusion.com/uwp-ui-controls), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls)), and desktop development ([WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/wpf-ui-controls), [UWP](https://www.syncfusion.com/uwp-ui-controls) and [WinUI](https://www.syncfusion.com/winui-controls)). We provide ready-to- deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.
\ No newline at end of file
diff --git a/packages/syncfusion_flutter_barcodes/lib/barcodes.dart b/packages/syncfusion_flutter_barcodes/lib/barcodes.dart
index 4da70cc7e..c60b884ac 100644
--- a/packages/syncfusion_flutter_barcodes/lib/barcodes.dart
+++ b/packages/syncfusion_flutter_barcodes/lib/barcodes.dart
@@ -5,6 +5,8 @@
///
/// To use, import `package:syncfusion_flutter_barcodes/barcodes.dart`.
///
+/// {@youtube 560 315 https://www.youtube.com/watch?v=ckAHrT2CR8A}
+///
/// See also:
/// * [Syncfusion Flutter Barcodes product page](https://www.syncfusion.com/flutter-widgets/flutter-barcodes)
/// * [User guide documentation](https://help.syncfusion.com/flutter/barcode/getting-started)
diff --git a/packages/syncfusion_flutter_calendar/CHANGELOG.md b/packages/syncfusion_flutter_calendar/CHANGELOG.md
index 733821cd8..5f3043455 100644
--- a/packages/syncfusion_flutter_calendar/CHANGELOG.md
+++ b/packages/syncfusion_flutter_calendar/CHANGELOG.md
@@ -1,4 +1,22 @@
-## [19.2.44]
+## Unreleased
+
+**Features**
+* Provided resize, drag-and-drop support to reschedule appointments in the event calendar.
+
+**Breaking changes**
+* The default `cellEndPadding` value has been changed in the SfCalendar.
+
+**Enhancements**
+* Now the calendar will return the recurrence appointment details in the given custom data type instead of `Appointment` type by overriding the `convertAppointmentToObject` method of the `CalendarDataSource`.
+
+## [19.2.55] - 08/11/2021
+**Bug fixes**
+* Now, the appointment will not intersect when the end time and start time of different appointment is 24 hours for two consecutive days.
+
+**Features**
+* Provided support to customize the background color of the all-day panel.
+
+## [19.2.44] - 06/30/2021
**Features**
* Provided support to display week numbers of the year.
* Provided ID, recurrence ID, and appointment type support.
diff --git a/packages/syncfusion_flutter_calendar/README.md b/packages/syncfusion_flutter_calendar/README.md
index 88b2acf3c..acaa1e9ee 100644
--- a/packages/syncfusion_flutter_calendar/README.md
+++ b/packages/syncfusion_flutter_calendar/README.md
@@ -85,6 +85,10 @@ The Flutter Calendar widget has built-in configurable views such as day, week, w

+* **Resize, drag and drop** - Resize and drag-and-drop support have been added for rescheduling appointments in the event calendar.
+
+
+
* **Quick view navigation** - Navigate among calendar views easily using the header date picker views button in the calendar header and clicking month cell and view headers.

@@ -316,4 +320,4 @@ class Meeting {
Founded in 2001 and headquartered in Research Triangle Park, N.C., Syncfusion has more than 20,000 customers and more than 1 million users, including large financial institutions, Fortune 500 companies, and global IT consultancies.
-Today we provide 1,000+ controls and frameworks for web ([ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls), [ASP.NET WebForms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), and [Blazor](https://www.syncfusion.com/blazor-components), mobile ([Xamarin](https://www.syncfusion.com/xamarin-ui-controls), [Flutter](https://www.syncfusion.com/flutter-widgets), [UWP](https://www.syncfusion.com/uwp-ui-controls), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls)), and desktop development ([WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/wpf-ui-controls), and [UWP](https://www.syncfusion.com/uwp-ui-controls)). We provide ready-to deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.
+Today we provide 1,000+ controls and frameworks for web ([ASP.NET Core](https://www.syncfusion.com/aspnet-core-ui-controls), [ASP.NET MVC](https://www.syncfusion.com/aspnet-mvc-ui-controls), [ASP.NET WebForms](https://www.syncfusion.com/jquery/aspnet-web-forms-ui-controls), [JavaScript](https://www.syncfusion.com/javascript-ui-controls), [Angular](https://www.syncfusion.com/angular-ui-components), [React](https://www.syncfusion.com/react-ui-components), [Vue](https://www.syncfusion.com/vue-ui-components), and [Blazor](https://www.syncfusion.com/blazor-components), mobile ([Xamarin](https://www.syncfusion.com/xamarin-ui-controls), [Flutter](https://www.syncfusion.com/flutter-widgets), [UWP](https://www.syncfusion.com/uwp-ui-controls), and [JavaScript](https://www.syncfusion.com/javascript-ui-controls)), and desktop development ([WinForms](https://www.syncfusion.com/winforms-ui-controls), [WPF](https://www.syncfusion.com/wpf-ui-controls), [UWP](https://www.syncfusion.com/uwp-ui-controls) and [WinUI](https://www.syncfusion.com/winui-controls)). We provide ready-to deploy enterprise software for dashboards, reports, data integration, and big data processing. Many customers have saved millions in licensing fees by deploying our software.
diff --git a/packages/syncfusion_flutter_calendar/lib/calendar.dart b/packages/syncfusion_flutter_calendar/lib/calendar.dart
index c63c1a418..af2aceb50 100644
--- a/packages/syncfusion_flutter_calendar/lib/calendar.dart
+++ b/packages/syncfusion_flutter_calendar/lib/calendar.dart
@@ -16,6 +16,7 @@ export 'src/calendar/common/calendar_controller.dart';
export 'src/calendar/common/enums.dart';
export 'src/calendar/common/event_args.dart';
export 'src/calendar/resource_view/calendar_resource.dart';
+export 'src/calendar/settings/drag_and_drop_settings.dart';
export 'src/calendar/settings/header_style.dart';
export 'src/calendar/settings/month_view_settings.dart';
export 'src/calendar/settings/resource_view_settings.dart';
@@ -24,5 +25,4 @@ export 'src/calendar/settings/time_region.dart';
export 'src/calendar/settings/time_slot_view_settings.dart';
export 'src/calendar/settings/view_header_style.dart';
export 'src/calendar/settings/week_number_style.dart';
-
export 'src/calendar/sfcalendar.dart';
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment.dart
index 4d6d3ff53..b7e07aa3e 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment.dart
@@ -14,6 +14,25 @@ import '../common/enums.dart';
/// _Note:_ The [startTime] and [endTime] properties must not be null to render
/// an appointment.
///
+/// See also:
+/// * [CalendarDataSource], to set and handle the appointment collection to the
+/// calendar.
+/// * [SfCalendar.appointmentBuilder], to set custom widget for the appointment
+/// view in the calendar
+/// * [SfCalendar.loadMoreWidgetBuilder], the widget which will be displayed
+/// when the appointments loading on the view in calendar.
+/// * [SfCalendar.appointmentTextStyle], to customize the appointment text, when
+/// the builder not added.
+/// * [SfCalendar.appointmentTimeTextFormat], to customize the time text format
+/// in the appointment view of calendar.
+/// * Knowledge base: [How to customize appointment using builder](https://www.syncfusion.com/kb/12191/how-to-customize-the-appointments-using-custom-builder-in-the-flutter-calendar)
+/// * Knowledge base: [How to load appointments on demand](https://www.syncfusion.com/kb/12658/how-to-load-appointments-on-demand-in-flutter-calendar)
+/// * Knowledge base: [How to style appointments](https://www.syncfusion.com/kb/12162/how-to-style-the-appointment-in-the-flutter-calendar)
+/// * Knowledge base: [How to format appointment time](https://www.syncfusion.com/kb/11989/how-to-format-the-appointment-time-in-the-flutter-calendar)
+/// * Knowledge base: [How to create time table](https://www.syncfusion.com/kb/12392/how-to-create-time-table-using-flutter-event-calendar)
+/// * Knowledge base: [How to add a custom appointments of business objects](https://www.syncfusion.com/kb/11529/how-to-add-a-custom-appointments-or-objects-in-the-flutter-calendar)
+/// * Knowledge base: [How to delete an appointment](https://www.syncfusion.com/kb/11522/how-to-delete-an-appointment-in-the-flutter-calendar)
+///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -77,6 +96,17 @@ class Appointment with Diagnosticable {
///
/// Defaults to `DateTime.now()`.
///
+ /// See also:
+ /// * [CalendarDataSource.getStartTime], which maps the custom business
+ /// objects corresponding property to this property.
+ /// * [isAllDay], which defines whether the event is all-day long or not
+ /// * [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].
+ /// * [SfCalendar.timeZone], to set the timezone for the calendar.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -124,6 +154,17 @@ class Appointment with Diagnosticable {
/// hour the appointment will be rendered on the all day panel of the time
/// slot views in [SfCalendar].
///
+ /// See also:
+ /// * [CalendarDataSource.getEndTime], which maps the custom business
+ /// objects corresponding property to this property.
+ /// * [isAllDay], which defines whether the event is all-day long or not
+ /// * [startTime], the date time value in which the appointment will start.
+ /// * [endTimeZone], the timezone for the end 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](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -171,6 +212,20 @@ class Appointment with Diagnosticable {
///
/// 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](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -210,6 +265,13 @@ class Appointment with Diagnosticable {
///
/// Defaults to ` ` represents empty string.
///
+ /// See also:
+ /// * [CalendarDataSource.getSubject], which maps the custom business
+ /// objects corresponding property to this property.
+ /// * [SfCalendar.appointmentTextStyle], to customize the appointment text,
+ /// when the builder not added.
+ /// * Knowledge base: [How to style appointments](https://www.syncfusion.com/kb/12162/how-to-style-the-appointment-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -250,6 +312,15 @@ class Appointment with Diagnosticable {
///
/// Defaults to `Colors.lightBlue`.
///
+ /// See also:
+ /// * [CalendarDataSource.getColor], which maps the custom business
+ /// objects corresponding property to this property.
+ /// * [SfCalendar.appointmentTextStyle], to customize the appointment text,
+ /// when the builder not added.
+ /// * [SfCalendar.appointmentBuilder], to set custom widget for the
+ /// appointment view in the calendar
+ /// * Knowledge base: [How to style appointments](https://www.syncfusion.com/kb/12162/how-to-style-the-appointment-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -292,6 +363,13 @@ class Appointment with Diagnosticable {
///
/// Defaults to null.
///
+ /// See also:
+ /// * [CalendarDataSource.getStartTimeZone], which maps the custom business
+ /// objects corresponding property to this property.
+ /// * [startTime], the date time value in which the appointment will start.
+ /// * [SfCalendar.timeZone], to set the timezone for the calendar.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -338,6 +416,16 @@ class Appointment with Diagnosticable {
/// zone's and it's value falls invalid, the appointment will render with half
/// an hour duration from the start time of the appointment.
///
+ /// See also:
+ /// * [CalendarDataSource.getEndTimeZone], which maps the custom business
+ /// objects corresponding property to this property.
+ /// * [endTime], the date time value in which the appointment will end.
+ /// * [endTimeZone], the timezone for the end 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](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -389,6 +477,20 @@ class Appointment with Diagnosticable {
///
/// Defaults to null.
///
+ /// See also:
+ /// * [CalendarDataSource.getRecurrenceRule], which maps the custom business
+ /// objects corresponding property to this property.
+ /// * [RecurrenceProperties], which used to create the recurrence rule based
+ /// on the values set to these properties.
+ /// * [SfCalendar.generateRRule], which used to generate recurrence rule
+ /// based on the [RecurrenceProperties] values.
+ /// * [SfCalendar.getRecurrenceDateTimeCollection], to get the recurrence date
+ /// time collection based on the given recurrence rule and start date.
+ /// * Knowledge base: [How to use a negative value for bysetpos in rrule](https://www.syncfusion.com/kb/12552/how-to-use-a-negative-value-for-bysetpos-in-a-rrule-of-recurrence-appointment-in-the)
+ /// * Knowledge base: [How to get the recurrence date collection](https://www.syncfusion.com/kb/12344/how-to-get-the-recurrence-date-collection-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add recurring appointments until specified date](https://www.syncfusion.com/kb/12158/how-to-add-recurring-appointments-until-the-specified-date-in-the-flutter-calendar)
+ ///
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -441,6 +543,17 @@ class Appointment with Diagnosticable {
///
/// Defaults to `[]`.
///
+ /// See also:
+ /// * [CalendarDataSource.getRecurrenceExceptionDates], which maps the custom
+ /// business objects corresponding property to this property.
+ /// * [recurrenceRule], which used to generate the recurrence appointment
+ /// based on the rule set.
+ /// * [RecurrenceProperties], which used to create the recurrence rule based
+ /// on the values set to these properties.
+ /// * [SfCalendar.generateRRule], which used to generate recurrence rule
+ /// based on the [RecurrenceProperties] values.
+ /// * Knowledge base: [How to exclude the dates from the recurrence appointments](https://www.syncfusion.com/kb/12161/how-to-exclude-the-dates-from-recurrence-appointments-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -497,6 +610,12 @@ class Appointment with Diagnosticable {
///
/// Defaults to null.
///
+ /// See also:
+ /// * [CalendarDataSource.getNotes], which maps the custom business objects
+ /// corresponding property to this property.
+ /// * [location], which used to store the location data of the appointment in
+ /// the calendar.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -553,6 +672,12 @@ class Appointment with Diagnosticable {
///
/// Defaults to null.
///
+ /// See also:
+ /// * [CalendarDataSource.getLocation], which maps the custom business objects
+ /// corresponding property to this property.
+ /// * [notes], which used to store some additional data or information about
+ /// the appointment in the calendar.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -608,12 +733,18 @@ class Appointment with Diagnosticable {
/// resource in calendar view.
///
/// See also:
- ///
- /// * [CalendarResource], the resource data for calendar.
+ /// * [CalendarDataSource.getResourceIds], which maps the custom business
+ /// objects corresponding property to this property.
+ /// * [CalendarResource], object which contains the resource data.
/// * [ResourceViewSettings], the settings have properties which allow to
/// customize the resource view of the [SfCalendar].
/// * [CalendarResource.id], the unique id for the [CalendarResource] view of
/// [SfCalendar].
+ /// * [CalendarDataSource], which used to set the resources collection to the
+ /// calendar.
+ /// * Knowledge base: [How to add appointment for the selected resource using appointment editor](https://www.syncfusion.com/kb/12109/how-to-add-appointment-for-the-selected-resources-using-appointment-editor-in-the-flutter)
+ /// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
+ /// * Knowledge base: [How to handle appointments for muliple resources](https://www.syncfusion.com/kb/11812/how-to-handle-appointments-for-multiple-resources-in-the-flutter-calendar)
///
/// ``` dart
///
@@ -678,6 +809,14 @@ class Appointment with Diagnosticable {
/// Exception recurrence appointment should not have a RRule. If the exception
/// appointment has RRule, it will not be considered.
///
+ /// See also:
+ /// * [CalendarDataSource.getRecurrenceId], which maps the custom business
+ /// objects corresponding property to this property.
+ /// * [id], which used to set unique identification number for the
+ /// [Appointment] object.
+ /// * [appointmentType], which used to identify the different appointment
+ /// types.
+ ///
/// ```dart
///AppointmentDataSource _getDataSource() {
/// List appointments = [];
@@ -721,7 +860,17 @@ class Appointment with Diagnosticable {
/// The exception appointment should have the different [id] value compared
/// to the pattern appointment. But the [recurrenceId] of the exception
/// appointment and the [id] value of the pattern appointment should be same.
+ ///
+ /// See also:
+ /// * [CalendarDataSource.id], which maps the custom business objects
+ /// corresponding property to this property.
+ /// * [recurrenceId], which used to create an exception/changed occurrence
+ /// appointment.
+ /// * [appointmentType], which used to identify the different appointment
+ /// types.
+ ///
/// ```dart
+ ///
/// AppointmentDataSource _getDataSource() {
/// List appointments = [];
///
@@ -754,10 +903,14 @@ class Appointment with Diagnosticable {
///Specifies the appointment type, which is used to distinguish appointments
/// based on their functionality.
+ ///
/// This is read-only.
+ ///
/// Defines the appointment type for the [Appointment].
///
- /// Also refer: [AppointmentType].
+ /// Also refer:
+ /// [AppointmentType], to know more about the available appointment types in
+ /// calendar.
///
/// ``` dart
///Widget build(BuildContext context) {
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment_helper.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment_helper.dart
index 94cd9a1af..c9a03ff23 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment_helper.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/appointment_helper.dart
@@ -12,6 +12,7 @@ import 'appointment.dart';
import 'calendar_datasource.dart';
import 'recurrence_helper.dart';
+// ignore: avoid_classes_with_only_static_members
/// Holds the static helper methods used for appointment rendering in calendar.
class AppointmentHelper {
/// Return the date with start time value for the date value.
@@ -34,6 +35,17 @@ class AppointmentHelper {
return DateTimeHelper.getDateTimeValue(addDays(getNextMonthDate(date), -1));
}
+ /// Return the difference duration between two date time values without
+ /// daylight savings.
+ static Duration getDifference(DateTime startDate, DateTime endDate) {
+ final Duration duration = endDate.difference(startDate);
+ if (startDate.timeZoneOffset == endDate.timeZoneOffset) {
+ return duration;
+ }
+
+ return duration + (endDate.timeZoneOffset - startDate.timeZoneOffset);
+ }
+
/// Return the date time value by adding the days in date.
static DateTime addDaysWithTime(
DateTime date, int days, int hour, int minute, int second) {
@@ -60,8 +72,7 @@ class AppointmentHelper {
appointment.actualStartTime.month &&
appointment.actualEndTime.year ==
appointment.actualStartTime.year) &&
- appointment.actualEndTime
- .difference(appointment.actualStartTime)
+ getDifference(appointment.actualStartTime, appointment.actualEndTime)
.inDays >
0;
}
@@ -95,8 +106,9 @@ class AppointmentHelper {
case CalendarView.week:
case CalendarView.workWeek:
{
- return appEndTime.difference(appStartTime).inDays <= 0 &&
- appStartTime.day != appEndTime.day;
+ return getDifference(appStartTime, appEndTime).inDays <= 0 &&
+ appStartTime.day != appEndTime.day &&
+ appEndTime.hour != 0;
}
case CalendarView.month:
{
@@ -109,10 +121,10 @@ class AppointmentHelper {
if (appStartTime.isAfter(viewStartDate)) {
final int appointmentStartWeek =
- appStartTime.difference(viewStartDate).inDays ~/
+ getDifference(viewStartDate, appStartTime).inDays ~/
DateTime.daysPerWeek;
final int appointmentEndWeek =
- appEndTime.difference(viewStartDate).inDays ~/
+ getDifference(viewStartDate, appEndTime).inDays ~/
DateTime.daysPerWeek;
return appointmentStartWeek != appointmentEndWeek;
}
@@ -124,9 +136,9 @@ class AppointmentHelper {
/// Returns recurrence icon details for appointment view.
static TextSpan getRecurrenceIcon(
- Color color, double textSize, bool isRecurrenceApointment) {
+ Color color, double textSize, bool isRecurrenceAppointment) {
final IconData recurrenceIconData =
- isRecurrenceApointment ? Icons.autorenew : Icons.sync_disabled;
+ isRecurrenceAppointment ? Icons.autorenew : Icons.sync_disabled;
return TextSpan(
text: String.fromCharCode(recurrenceIconData.codePoint),
style: TextStyle(
@@ -161,13 +173,13 @@ class AppointmentHelper {
DateTime date, SfLocalizations localization) {
final DateTime exactStartTime =
convertToStartTime(appointment.exactStartTime);
- final String totalDays = (convertToEndTime(appointment.exactEndTime)
- .difference(exactStartTime)
+ final String totalDays = (getDifference(
+ exactStartTime, convertToEndTime(appointment.exactEndTime))
.inDays +
1)
.toString();
final String currentDate =
- (convertToEndTime(date).difference(exactStartTime).inDays + 1)
+ (getDifference(exactStartTime, convertToEndTime(date)).inDays + 1)
.toString();
return appointment.subject +
@@ -264,7 +276,7 @@ class AppointmentHelper {
notes: appointment.notes,
location: appointment.location,
isSpanned: appointment.isSpanned,
- resourceIds: appointment.resourceIds,
+ resourceIds: CalendarViewHelper.cloneList(appointment.resourceIds),
recurrenceId: appointment.recurrenceId,
id: appointment.id);
copyAppointment.actualStartTime = appointment.actualStartTime;
@@ -540,15 +552,14 @@ class AppointmentHelper {
minimumAppointmentMinutes > timeIntervalMinutes
? timeIntervalMinutes
: minimumAppointmentMinutes;
- if (currentAppointmentEndTime
- .difference(currentAppointmentStartTime)
+ if (getDifference(currentAppointmentStartTime, currentAppointmentEndTime)
.inMinutes <
minimumAppointmentMinutes) {
currentAppointmentEndTime = currentAppointmentStartTime
.add(Duration(minutes: minimumAppointmentMinutes));
}
- if (appointmentEndTime.difference(appointmentStartTime).inMinutes <
+ if (getDifference(appointmentStartTime, appointmentEndTime).inMinutes <
minimumAppointmentMinutes) {
appointmentEndTime = appointmentStartTime
.add(Duration(minutes: minimumAppointmentMinutes));
@@ -971,9 +982,12 @@ class AppointmentHelper {
appointment.exactStartTime.month ==
appointment.exactEndTime.month) &&
appointment.exactStartTime.isBefore(appointment.exactEndTime) &&
- (appointment.exactEndTime.difference(appointment.exactStartTime))
+ getDifference(
+ appointment.exactStartTime, appointment.exactEndTime)
.inDays ==
0 &&
+ (appointment.exactEndTime.hour != 0 ||
+ appointment.exactEndTime.minute != 0) &&
!appointment.isAllDay &&
!isTimelineView) {
for (int i = 0; i < 2; i++) {
@@ -1000,12 +1014,12 @@ class AppointmentHelper {
? appointment.actualStartTime
: convertTimeToAppointmentTimeZone(
appointment.actualStartTime,
- appointment.startTimeZone,
- calendarTimeZone);
+ calendarTimeZone,
+ appointment.startTimeZone);
spannedAppointment.endTime = spannedAppointment.isAllDay
? appointment.actualEndTime
: convertTimeToAppointmentTimeZone(appointment.actualEndTime,
- appointment.endTimeZone, calendarTimeZone);
+ calendarTimeZone, appointment.endTimeZone);
// Adding Spanned Appointment only when the Appointment range
// within the VisibleDate
@@ -1047,14 +1061,14 @@ class AppointmentHelper {
? appointment.actualStartTime
: convertTimeToAppointmentTimeZone(
appointment.actualStartTime,
- appointment.startTimeZone,
- calendarTimeZone);
+ calendarTimeZone,
+ appointment.startTimeZone);
spannedAppointment.endTime = spannedAppointment.isAllDay
? appointment.actualEndTime
: convertTimeToAppointmentTimeZone(
appointment.actualEndTime,
- appointment.endTimeZone,
- calendarTimeZone);
+ calendarTimeZone,
+ appointment.endTimeZone);
// Adding Spanned Appointment only when the Appointment range
// within the VisibleDate
@@ -1087,14 +1101,14 @@ class AppointmentHelper {
? appointment.actualStartTime
: convertTimeToAppointmentTimeZone(
appointment.actualStartTime,
- appointment.startTimeZone,
- calendarTimeZone);
+ calendarTimeZone,
+ appointment.startTimeZone);
spannedAppointment.endTime = spannedAppointment.isAllDay
? appointment.actualEndTime
: convertTimeToAppointmentTimeZone(
appointment.actualEndTime,
- appointment.endTimeZone,
- calendarTimeZone);
+ calendarTimeZone,
+ appointment.endTimeZone);
// Adding Spanned Appointment only when the Appointment range
// within the VisibleDate
@@ -1134,14 +1148,14 @@ class AppointmentHelper {
? appointment.actualStartTime
: convertTimeToAppointmentTimeZone(
appointment.actualStartTime,
- appointment.startTimeZone,
- calendarTimeZone);
+ calendarTimeZone,
+ appointment.startTimeZone);
spannedAppointment.endTime = spannedAppointment.isAllDay
? appointment.actualEndTime
: convertTimeToAppointmentTimeZone(
appointment.actualEndTime,
- appointment.endTimeZone,
- calendarTimeZone);
+ calendarTimeZone,
+ appointment.endTimeZone);
// Adding Spanned Appointment only when the Appointment range
// within the VisibleDate
@@ -1187,24 +1201,24 @@ class AppointmentHelper {
? occurrenceAppointment.actualStartTime
: convertTimeToAppointmentTimeZone(
occurrenceAppointment.actualStartTime,
- occurrenceAppointment.startTimeZone,
- calendarTimeZone);
+ calendarTimeZone,
+ occurrenceAppointment.startTimeZone);
- final int minutes = appointment.actualEndTime
- .difference(appointment.actualStartTime)
- .inMinutes;
+ final int minutes =
+ getDifference(appointment.actualStartTime, appointment.actualEndTime)
+ .inMinutes;
occurrenceAppointment.actualEndTime = DateTimeHelper.getDateTimeValue(
addDuration(
occurrenceAppointment.actualStartTime, Duration(minutes: minutes)));
occurrenceAppointment.endTime = occurrenceAppointment.isAllDay
? occurrenceAppointment.actualEndTime
: convertTimeToAppointmentTimeZone(occurrenceAppointment.actualEndTime,
- occurrenceAppointment.endTimeZone, calendarTimeZone);
+ calendarTimeZone, occurrenceAppointment.endTimeZone);
occurrenceAppointment.isSpanned = _isSpanned(occurrenceAppointment) &&
- (occurrenceAppointment.endTime
- .difference(occurrenceAppointment.startTime)
+ getDifference(occurrenceAppointment.startTime,
+ occurrenceAppointment.endTime)
.inDays >
- 0);
+ 0;
occurrenceAppointment.exactStartTime =
occurrenceAppointment.actualStartTime;
occurrenceAppointment.exactEndTime = occurrenceAppointment.actualEndTime;
@@ -1250,7 +1264,7 @@ class AppointmentHelper {
calendarAppointmentCollection.add(item);
item.isSpanned = _isSpanned(item) &&
- (appEndTime.difference(appStartTime).inDays > 0);
+ getDifference(appStartTime, appEndTime).inDays > 0;
}
} else {
for (int i = 0; i < dataSource.length; i++) {
@@ -1260,8 +1274,8 @@ class AppointmentHelper {
final DateTime appStartTime = app.startTime;
final DateTime appEndTime = app.endTime;
- app.isSpanned =
- _isSpanned(app) && (appEndTime.difference(appStartTime).inDays > 0);
+ app.isSpanned = _isSpanned(app) &&
+ getDifference(appStartTime, appEndTime).inDays > 0;
calendarAppointmentCollection.add(app);
}
}
@@ -1327,8 +1341,8 @@ class AppointmentHelper {
!appointment.isAllDay) {
appointment.endTime = convertTimeToAppointmentTimeZone(
addDuration(appointment.actualStartTime, const Duration(minutes: 30)),
- appointment.endTimeZone,
- scheduleTimeZone);
+ scheduleTimeZone,
+ appointment.endTimeZone);
appointment.actualEndTime = !appointment.isAllDay
? convertTimeToAppointmentTimeZone(
appointment.endTime, appointment.endTimeZone, scheduleTimeZone)
@@ -1358,8 +1372,8 @@ class AppointmentHelper {
final List recursiveDates =
RecurrenceHelper.getRecurrenceDateTimeCollection(
rule, appointment.actualStartTime,
- recurrenceDuration:
- appointment.exactEndTime.difference(appointment.exactStartTime),
+ recurrenceDuration: getDifference(
+ appointment.exactStartTime, appointment.exactEndTime),
specificStartDate: visibleStartDate,
specificEndDate: visibleEndDate);
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/calendar_datasource.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/calendar_datasource.dart
index 3abd351e6..90db0414b 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/calendar_datasource.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/calendar_datasource.dart
@@ -20,6 +20,38 @@ import '../resource_view/calendar_resource.dart';
/// Allows to add and remove an [Appointment] from the collection and also
/// allows to reset the appointment collection for [SfCalendar].
///
+/// See also:
+/// * [Appointment], the object which holds the details of the appointment.
+/// * [CalendarResource], the object which holds the details of the resource
+/// in the calendar.
+/// * [SfCalendar.loadMoreWidgetBuilder], allows to build an widget which will
+/// display when appointments loaded on demand in the calendar.
+/// * [SfCalendar.resourceViewHeaderBuilder], to set custom widget for the
+/// resource view in the calendar.
+/// * [resourceViewSettings], to customize the resource view in the calendar.
+/// * [SfCalendar.appointmentBuilder], to set custom widget for the appointment
+/// view in the calendar.
+/// * [SfCalendar.appointmentTextStyle], to customize the text style for the
+/// appointments in calendar.
+/// * [SfCalendar.appointmentTimeTextFormat], to customize the time format for
+/// the appointment view in calendar.
+/// * Knowledge base: [How to perform the crud operations using firestore database](https://www.syncfusion.com/kb/12661/how-to-perform-the-crud-operations-in-flutter-calendar-using-firestore-database)
+/// * Knowledge base: [How to load appointments on demand](https://www.syncfusion.com/kb/12658/how-to-load-appointments-on-demand-in-flutter-calendar)
+/// * Knowledge base: [How to load google calendar events in iOS](https://www.syncfusion.com/kb/12647/how-to-load-the-google-calendar-events-to-the-flutter-calendar-sfcalendar-in-ios)
+/// * Knowledge base: [How to get the appointments between the given start and end date](https://www.syncfusion.com/kb/12549/how-to-get-the-appointments-between-the-given-start-and-end-date-in-the-flutter-calendar)
+/// * Knowledge base: [How to get the current month appointments](https://www.syncfusion.com/kb/12477/how-to-get-the-current-month-appointments-in-the-flutter-calendar)
+/// * Knowledge base: [How to load data from offline sqlite database](https://www.syncfusion.com/kb/12399/how-to-load-data-from-offline-sqlite-database-to-flutter-calendar)
+/// * Knowledge base: [How to create time table](https://www.syncfusion.com/kb/12392/how-to-create-time-table-using-flutter-event-calendar)
+/// * Knowledge base: [How to add google calendar events](https://www.syncfusion.com/kb/12116/how-to-add-google-calendar-events-to-the-flutter-event-calendar-sfcalendar)
+/// * Knowledge base: [How to add a custom appointments of business objects](https://www.syncfusion.com/kb/11529/how-to-add-a-custom-appointments-or-objects-in-the-flutter-calendar)
+/// * Knowledge base: [How to add additional attributes in events](https://www.syncfusion.com/kb/12209/how-to-add-additional-attributes-in-events-in-the-flutter-calendar)
+/// * Knowledge base: [How to work with the firebase database and flutter calendar for appointments](https://www.syncfusion.com/kb/12067/how-to-work-with-the-firebase-database-and-the-flutter-calendar-for-appointments)
+/// * Knowledge base: [How to integrate [SfCalendar] with [SfDateRangePicker]](https://www.syncfusion.com/kb/12047/how-to-integrate-event-calendar-sfcalendar-with-date-picker-sfdaterangepicker-in-flutter)
+/// * Knowledge base: [How to handle appointments for multiple resources](https://www.syncfusion.com/kb/11812/how-to-handle-appointments-for-multiple-resources-in-the-flutter-calendar)
+/// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+/// * Knowledge base: [How to design and configure your appointment editor](https://www.syncfusion.com/kb/11204/how-to-design-and-configure-your-appointment-editor-in-flutter-calendar)
+/// * Knowledge base: [How to load offline json data](https://www.syncfusion.com/kb/11466/how-to-load-the-json-data-offline-for-the-flutter-calendar-appointments)
+///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -121,11 +153,42 @@ import '../resource_view/calendar_resource.dart';
/// return MeetingDataSource(appointments);
/// }
/// ```
-abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
+@optionalTypeArgs
+abstract class CalendarDataSource
+ extends CalendarDataSourceChangeNotifier {
/// Tha collection of appointments to be rendered on [SfCalendar].
///
/// Defaults to `null`.
///
+ /// See also:
+ /// * [Appointment], the object to hold the data for the event in the
+ /// calendar.
+ /// * [resources], to set and handle the resource collection to the
+ /// [SfCalendar].
+ /// * [SfCalendar.appointmentBuilder], to set custom widget for the
+ /// appointment view in the calendar
+ /// * [SfCalendar.loadMoreWidgetBuilder], the widget which will be displayed
+ /// when the appointments loading on the view in calendar.
+ /// * [SfCalendar.appointmentTextStyle], to customize the appointment text,
+ /// when the builder not added.
+ /// * [SfCalendar.appointmentTimeTextFormat], to customize the time text
+ /// format in the appointment view of calendar.
+ /// * [handleLoadMore], method to load the appointment when the view changed
+ /// in calendar, and on [CalendarView.schedule] when the view reached it's
+ /// start or end position.
+ /// * Knowledge base: [How to perform the crud operations using firestore database](https://www.syncfusion.com/kb/12661/how-to-perform-the-crud-operations-in-flutter-calendar-using-firestore-database)
+ /// * Knowledge base: [How to load appointments on demand](https://www.syncfusion.com/kb/12658/how-to-load-appointments-on-demand-in-flutter-calendar)
+ /// * Knowledge base: [How to create time table](https://www.syncfusion.com/kb/12392/how-to-create-time-table-using-flutter-event-calendar)
+ /// * Knowledge base: [How to add a custom appointments of business objects](https://www.syncfusion.com/kb/11529/how-to-add-a-custom-appointments-or-objects-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add additional attributes in events](https://www.syncfusion.com/kb/12209/how-to-add-additional-attributes-in-events-in-the-flutter-calendar)
+ /// * Knowledge base: [How to work with the firebase database and flutter calendar for appointments](https://www.syncfusion.com/kb/12067/how-to-work-with-the-firebase-database-and-the-flutter-calendar-for-appointments)
+ /// * Knowledge base: [How to integrate [SfCalendar] with [SfDateRangePicker]](https://www.syncfusion.com/kb/12047/how-to-integrate-event-calendar-sfcalendar-with-date-picker-sfdaterangepicker-in-flutter)
+ /// * Knowledge base: [How to handle appointments for multiple resources](https://www.syncfusion.com/kb/11812/how-to-handle-appointments-for-multiple-resources-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to design and configure your appointment editor](https://www.syncfusion.com/kb/11204/how-to-design-and-configure-your-appointment-editor-in-flutter-calendar)
+ /// * Knowledge base: [How to load offline json data](https://www.syncfusion.com/kb/11466/how-to-load-the-json-data-offline-for-the-flutter-calendar-appointments)
+ /// * Knowledge base: [How to delete an appointment](https://www.syncfusion.com/kb/11522/how-to-delete-an-appointment-in-the-flutter-calendar)
+ ///
/// ```dat
///
/// class _AppointmentDataSource extends CalendarDataSource {
@@ -144,6 +207,16 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// endDate - optional - The end date till which
/// to obtain the visible appointments.
///
+ /// See also:
+ /// * [Appointment], the object to hold the data for the event in the
+ /// calendar.
+ /// * [getPatternAppointment], which allows to get the pattern appointment of
+ /// the given occurrence appointment in calendar.
+ /// * [getOccurrenceAppointment], which allows to get the occurrence
+ /// appointment of the pattern appointment in the calendar.
+ /// * Knowledge base: [How to get the appointments between the given start and end date](https://www.syncfusion.com/kb/12549/how-to-get-the-appointments-between-the-given-start-and-end-date-in-the-flutter-calendar)
+ /// * Knowledge base: [How to get the current month appointments](https://www.syncfusion.com/kb/12477/how-to-get-the-current-month-appointments-in-the-flutter-calendar)
+ ///
/// ```dart
///
/// class MyAppState extends State {
@@ -246,70 +319,79 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// date - required - The date on which the
/// occurrence appointment is requested.
///
+ /// See also:
+ /// * [Appointment], the object to hold the data for the event in the
+ /// calendar.
+ /// * [getVisibleAppointments], which allows to get the appointment
+ /// collection between the given date range.
+ /// * [getPatternAppointment], which allows to get the pattern appointment of
+ /// the given occurrence appointment in calendar.
+ /// * [SfCalendar.getRecurrenceDateTimeCollection], which used to get the
+ /// recurrence date time collection for the given recurrence rule.
+ ///
/// ```dart
///
/// class MyAppState extends State{
+ /// late CalendarController _calendarController;
+ /// late _AppointmentDataSource _dataSource;
+ /// late Appointment recurrenceApp;
///
- /// CalendarController _calendarController;
- /// _AppointmentDataSource _dataSource;
- /// Appointment recurrenceApp;
- /// @override
- /// initState(){
- /// _calendarController = CalendarController();
- /// _dataSource = _getCalendarDataSource();
- /// super.initState();
- /// }
+ /// @override
+ /// initState(){
+ /// _calendarController = CalendarController();
+ /// _dataSource = _getCalendarDataSource();
+ /// super.initState();
+ /// }
///
- /// @override
- /// Widget build(BuildContext context) {
- /// return MaterialApp(
- /// home: Scaffold(
- /// body: SfCalendar(
- /// view: CalendarView.month,
- /// controller: _calendarController,
- /// dataSource: _dataSource,
- /// onTap: (CalendarTapDetails details) {
- /// DateTime date = details.date;
- /// String calendarTimeZone = '';
- /// Appointment appointment = _dataSource.getOccurrenceAppointment(
- /// recurrenceApp, date, calendarTimeZone);
- /// },
- /// ),
+ /// @override
+ /// Widget build(BuildContext context) {
+ /// return MaterialApp(
+ /// home: Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// controller: _calendarController,
+ /// dataSource: _dataSource,
+ /// initialDisplayDate: DateTime(2020,11,27,9),
+ /// onTap: (CalendarTapDetails details) {
+ /// final DateTime? date = details.date;
+ /// final Appointment? occurrenceAppointment =
+ /// _dataSource.getOccurrenceAppointment(
+ /// recurrenceApp, date!, '');
+ /// },
+ /// ),
/// ),
- /// );
- /// }
- ///}
- ///
- /// _AppointmentDataSource _getCalendarDataSource() {
- /// List appointments = [];
- /// recurrenceApp = appointments.add(Appointment(
- /// startTime: DateTime(2020,11,27,9),
- /// endTime: DateTime(2020,11,27,9).add(Duration(hours: 2)),
- /// subject: 'Meeting',
- /// color: Colors.cyanAccent,
- /// startTimeZone: '',
- /// endTimeZone: '',
- /// recurrenceRule: 'FREQ=DAILY;INTERVAL=2;COUNT=5',
- /// ));
- /// appointments.add(recurrenceApp);
- /// appointments.add(Appointment(
- /// startTime: DateTime(2020,11,28,5),
- /// endTime: DateTime(2020,11,30,7),
- /// subject: 'Discussion',
- /// color: Colors.orangeAccent,
- /// startTimeZone: '',
- /// endTimeZone: '',
- /// isAllDay: true
+ /// );
+ /// }
+ /// _AppointmentDataSource _getCalendarDataSource() {
+ /// final List appointments = [];
+ /// recurrenceApp = Appointment(
+ /// startTime: DateTime(2020,11,27,9),
+ /// endTime: DateTime(2020,11,27,9).add(const Duration(hours: 2)),
+ /// subject: 'Meeting',
+ /// color: Colors.cyanAccent,
+ /// startTimeZone: '',
+ /// endTimeZone: '',
+ /// recurrenceRule: 'FREQ=DAILY;INTERVAL=2;COUNT=5',
+ /// );
+ /// appointments.add(recurrenceApp);
+ /// appointments.add(Appointment(
+ /// startTime: DateTime(2020,11,28,5),
+ /// endTime: DateTime(2020,11,30,7),
+ /// subject: 'Discussion',
+ /// color: Colors.orangeAccent,
+ /// startTimeZone: '',
+ /// endTimeZone: '',
+ /// isAllDay: true
/// ));
- /// return _AppointmentDataSource(appointments);
+ /// return _AppointmentDataSource(appointments);
/// }
/// }
- ///
/// class _AppointmentDataSource extends CalendarDataSource {
- /// _AppointmentDataSource(List source){
+ /// _AppointmentDataSource(List source){
/// appointments = source;
- /// }
- ///}
+ /// }
+ /// }
+ ///
/// ```
Appointment? getOccurrenceAppointment(
Object? patternAppointment, DateTime date, String calendarTimeZone) {
@@ -360,70 +442,80 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// occurrenceAppointment - required - The occurrence appointment for which
/// the Pattern appointment is obtained.
///
+ /// * [Appointment], the object to hold the data for the event in the
+ /// calendar.
+ /// * [getVisibleAppointments], which allows to get the appointment
+ /// collection between the given date range.
+ /// * [getOccurrenceAppointment], which allows to get the occurrence
+ /// appointment of the given pattern appointment in calendar.
+ /// * [SfCalendar.getRecurrenceDateTimeCollection], which used to get the
+ /// recurrence date time collection for the given recurrence rule.
+ ///
/// ```dart
///
/// class MyAppState extends State{
- ///
- /// CalendarController _calendarController;
- /// _AppointmentDataSource _dataSource;
- /// Appointment recurrenceApp;
- /// @override
- /// initState(){
- /// _calendarController = CalendarController();
- /// _dataSource = _getCalendarDataSource();
- /// super.initState();
- /// }
- ///
- /// @override
- /// Widget build(BuildContext context) {
- /// return MaterialApp(
- /// home: Scaffold(
- /// body: SfCalendar(
- /// view: CalendarView.month,
- /// controller: _calendarController,
- /// dataSource: _dataSource,
- /// onTap: (CalendarTapDetails details) {
- /// DateTime date = details.date;
- /// String calendarTimeZone = '';
- /// Appointment appointment = _dataSource.getPatternAppointment(
- /// occurrenceAppointment, calendarTimeZone);
- /// },
- /// ),
- /// ),
- /// );
- /// }
- ///}
- ///
- /// _AppointmentDataSource _getCalendarDataSource() {
- /// List appointments = [];
- /// recurrenceApp = appointments.add(Appointment(
- /// startTime: DateTime(2020,11,27,9),
- /// endTime: DateTime(2020,11,27,9).add(Duration(hours: 2)),
- /// subject: 'Meeting',
- /// color: Colors.cyanAccent,
- /// startTimeZone: '',
- /// endTimeZone: '',
- /// recurrenceRule: 'FREQ=DAILY;INTERVAL=2;COUNT=5',
- /// ));
- /// appointments.add(recurrenceApp);
- /// appointments.add(Appointment(
- /// startTime: DateTime(2020,11,28,5),
- /// endTime: DateTime(2020,11,30,7),
- /// subject: 'Discussion',
- /// color: Colors.orangeAccent,
- /// startTimeZone: '',
- /// endTimeZone: '',
- /// isAllDay: true
+ /// late CalendarController _calendarController;
+ /// late _AppointmentDataSource _dataSource;
+ /// late Appointment recurrenceApp;
+ /// @override
+ /// initState(){
+ /// _calendarController = CalendarController();
+ /// _dataSource = _getCalendarDataSource();
+ /// super.initState();
+ /// }
+ /// @override
+ /// Widget build(BuildContext context) {
+ /// return MaterialApp(
+ /// home: Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// controller: _calendarController,
+ /// dataSource: _dataSource,
+ /// initialDisplayDate: DateTime(2020,11,27,9),
+ /// onTap: (CalendarTapDetails details) {
+ /// if(details.appointments!.isNotEmpty &&
+ /// details.appointments != null){
+ /// final dynamic occurrenceAppointment =
+ /// details.appointments![0];
+ /// final Appointment? patternAppointment =
+ /// _dataSource.getPatternAppointment(
+ /// occurrenceAppointment, '') as Appointment?;
+ /// }
+ /// },
+ /// ),
+ /// ),
+ /// );
+ /// }
+ /// _AppointmentDataSource _getCalendarDataSource() {
+ /// List appointments = [];
+ /// recurrenceApp = Appointment(
+ /// startTime: DateTime(2020,11,27,9),
+ /// endTime: DateTime(2020,11,27,9).add(Duration(hours: 2)),
+ /// subject: 'Meeting',
+ /// color: Colors.cyanAccent,
+ /// startTimeZone: '',
+ /// endTimeZone: '',
+ /// recurrenceRule: 'FREQ=DAILY;INTERVAL=2;COUNT=5',
+ /// );
+ /// appointments.add(recurrenceApp);
+ /// appointments.add(Appointment(
+ /// startTime: DateTime(2020,11,28,5),
+ /// endTime: DateTime(2020,11,30,7),
+ /// subject: 'Discussion',
+ /// color: Colors.orangeAccent,
+ /// startTimeZone: '',
+ /// endTimeZone: '',
+ /// isAllDay: true
/// ));
- /// return _AppointmentDataSource(appointments);
+ /// return _AppointmentDataSource(appointments);
/// }
/// }
- ///
/// class _AppointmentDataSource extends CalendarDataSource {
- /// _AppointmentDataSource(List source){
+ /// _AppointmentDataSource(List source){
/// appointments = source;
- /// }
- ///}
+ /// }
+ /// }
+ ///
/// ```
Object? getPatternAppointment(
Object? occurrenceAppointment, String calendarTimeZone) {
@@ -452,7 +544,8 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
dataSourceAppointments[i];
if ((dataSourceAppointment.id ==
occurrenceCalendarAppointment.recurrenceId) ||
- (dataSourceAppointment.id == occurrenceCalendarAppointment.id)) {
+ (occurrenceCalendarAppointment.recurrenceId == null &&
+ dataSourceAppointment.id == occurrenceCalendarAppointment.id)) {
return dataSourceAppointment.data;
}
}
@@ -464,6 +557,21 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
///
/// Defaults to `null`.
///
+ /// See also:
+ /// * [CalendarResource], the object to hold the data for the resource in the
+ /// calendar.
+ /// * [appointments], to set and handle the resource collection to the
+ /// [SfCalendar].
+ /// * [TimeRegion], the object to hold the data for the special time region in
+ /// the calendar.
+ /// * [SfCalendar.resourceViewHeaderBuilder], to set custom widget for the
+ /// resource view in the calendar.
+ /// * [resourceViewSettings], to customize the resource view in the calendar.
+ /// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
+ /// * Knowledge base: [How to handle appointments for multiple resources](https://www.syncfusion.com/kb/11812/how-to-handle-appointments-for-multiple-resources-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add appointment for the selected resources using appointment editor](https://www.syncfusion.com/kb/12109/how-to-add-appointment-for-the-selected-resources-using-appointment-editor-in-the-flutter)
+ ///
/// ```dart
///
/// class AppointmentDataSource extends CalendarDataSourceResource {
@@ -488,7 +596,17 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// It is mandatory to override this method to set custom appointments
/// collection to the [appointments].
///
- /// See also: [Appointment.startTime]
+ /// See also:
+ /// * [Appointment.startTime], the date time value in which the appointment
+ /// will start.
+ /// * [isAllDay], which used to map the custom appointment's
+ /// [Appointment.isAllDay] property to the [Appointment].
+ /// * [getEndTime], which used to map the custom appointment's
+ /// [Appointment.endTime] property to the [Appointment].
+ /// * [getStartTimeZone], which used to map the custom appointment's
+ /// [Appointment.startTimeZone] property to the [Appointment].
+ /// * [SfCalendar.timeZone], to set the timezone for the calendar.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
///
/// ```dart
/// @override
@@ -509,7 +627,17 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// It is mandatory to override this method to set custom appointments
/// collection to the [appointments].
///
- /// See also: [Appointment.endTime]
+ /// See also:
+ /// * [Appointment.endTime], the date time value in which the appointment
+ /// will end.
+ /// * [isAllDay], which used to map the custom appointment's
+ /// [Appointment.isAllDay] property to the [Appointment].
+ /// * [getStartTime], which used to map the custom appointment
+ /// [Appointment.startTime] property to the [Appointment].
+ /// * [getEndTimeZone], which used to map the custom appointment's
+ /// [Appointment.endTimeZone] property to the [Appointment].
+ /// * [SfCalendar.timeZone], to set the timezone for the calendar.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
///
/// ```dart
/// @override
@@ -527,7 +655,12 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.subject]
+ /// See also:
+ /// * [Appointment.subject], which holds the subject of the appointment which
+ /// will be displayed on the event UI.
+ /// * [SfCalendar.appointmentTextStyle], to customize the appointment text,
+ /// when the builder not added.
+ /// * Knowledge base: [How to style appointments](https://www.syncfusion.com/kb/12162/how-to-style-the-appointment-in-the-flutter-calendar)
///
/// ```dart
/// @override
@@ -545,7 +678,19 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.isAllDay]
+ /// See also:
+ /// * [Appointment.isAllDay], which defines whether the event is a day long or
+ /// not.
+ /// * [getStartTime], which used to map the custom appointment
+ /// [Appointment.startTime] property to the [Appointment].
+ /// * [getEndTime], which used to map the custom appointment
+ /// [Appointment.endTime] property to the [Appointment].
+ /// * [getStartTimeZone], which used to map the custom appointment's
+ /// [Appointment.startTimeZone] property to the [Appointment].
+ /// * [getEndTimeZone], which used to map the custom appointment's
+ /// [Appointment.endTimeZone] property to the [Appointment].
+ /// * [SfCalendar.timeZone], to set the timezone for the calendar.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
///
/// ```dart
/// @override
@@ -563,7 +708,14 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.color]
+ /// See also:
+ /// * [Appointment.color], which fills the background of the appointment view
+ /// in the [SfCalendar].
+ /// * [SfCalendar.appointmentTextStyle], to customize the appointment text,
+ /// when the builder not added.
+ /// * [SfCalendar.appointmentBuilder], to set custom widget for the
+ /// appointment view in the calendar
+ /// * Knowledge base: [How to style appointments](https://www.syncfusion.com/kb/12162/how-to-style-the-appointment-in-the-flutter-calendar)
///
/// ```dart
/// @override
@@ -581,7 +733,12 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.notes]
+ /// See also:
+ /// * [Appointment.notes], which stored some note of the appointment in the
+ /// calendar.
+ /// * [getLocation], which maps the custom appointment's
+ /// [Appointment.location] property to the [Appointment]
+ ///
///
/// ```dart
/// @override
@@ -599,7 +756,11 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.location].
+ /// See also:
+ /// * [Appointment.location], which used to store the location data of the
+ /// event in the calendar.
+ /// * [getNotes], which maps the custom appointment's [Appointment.notes]
+ /// property to the [Appointment]
///
/// ```dart
/// @override
@@ -617,7 +778,14 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.startTimeZone].
+ /// See also:
+ /// * [Appointment.startTimeZone], which sets the time zone for the start time
+ /// of the appointment.
+ /// * [getEndTime], which used to map the custom appointment's
+ /// [Appointment.endTime] property to the [Appointment].
+ /// * [SfCalendar.timeZone], to set the timezone for the calendar.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
///
/// ```dart
/// @override
@@ -635,7 +803,13 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.endTimeZone].
+ /// See also:
+ /// * [Appointment.endTimeZone], which sets the time zone for the end time
+ /// of the appointment.
+ /// * [getStartTime], which used to map the custom appointment's
+ /// [Appointment.startTime] property to the [Appointment].
+ /// * [SfCalendar.timeZone], to set the timezone for the calendar.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
///
/// ```dart
/// @override
@@ -653,7 +827,18 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.recurrenceRule].
+ /// See also:
+ /// * [Appointment.recurrenceRule], which used to recur the appointment based
+ /// on the given rule.
+ /// * [RecurrenceProperties], which used to create the recurrence rule based
+ /// on the values set to these properties.
+ /// * [SfCalendar.generateRRule], which used to generate recurrence rule
+ /// based on the [RecurrenceProperties] values.
+ /// * [SfCalendar.getRecurrenceDateTimeCollection], to get the recurrence date
+ /// time collection based on the given recurrence rule and start date.
+ /// * Knowledge base: [How to use a negative value for bysetpos in rrule](https://www.syncfusion.com/kb/12552/how-to-use-a-negative-value-for-bysetpos-in-a-rrule-of-recurrence-appointment-in-the)
+ /// * Knowledge base: [How to get the recurrence date collection](https://www.syncfusion.com/kb/12344/how-to-get-the-recurrence-date-collection-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add recurring appointments until specified date](https://www.syncfusion.com/kb/12158/how-to-add-recurring-appointments-until-the-specified-date-in-the-flutter-calendar)
///
/// ```dart
/// @override
@@ -671,7 +856,16 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.recurrenceExceptionDates].
+ /// See also:
+ /// * [Appointment.recurrenceExceptionDates], which used to exclude some dates
+ /// from the recurrence series of the appointment.
+ /// * [getRecurrenceRule],which used to map the custom appointment's
+ /// [Appointment.recurrenceRule] property of the [Appointment].
+ /// * [RecurrenceProperties], which used to create the recurrence rule based
+ /// on the values set to these properties.
+ /// * [SfCalendar.generateRRule], which used to generate recurrence rule
+ /// based on the [RecurrenceProperties] values.
+ /// * Knowledge base: [How to exclude the dates from the recurrence appointments](https://www.syncfusion.com/kb/12161/how-to-exclude-the-dates-from-recurrence-appointments-in-the-flutter-calendar)
///
/// ```dart
/// @override
@@ -688,9 +882,18 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// [appointments].
///
/// See also:
- ///
/// * [Appointment.resourceIds], the ids of the [CalendarResource] that shares
/// this [Appointment].
+ /// * [CalendarResource], object which contains the resource data.
+ /// * [ResourceViewSettings], the settings have properties which allow to
+ /// customize the resource view of the [SfCalendar].
+ /// * [CalendarResource.id], the unique id for the [CalendarResource] view of
+ /// [SfCalendar].
+ /// * [resources], which used to set and handle the resources collection to
+ /// the calendar.
+ /// * Knowledge base: [How to add appointment for the selected resource using appointment editor](https://www.syncfusion.com/kb/12109/how-to-add-appointment-for-the-selected-resources-using-appointment-editor-in-the-flutter)
+ /// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
+ /// * Knowledge base: [How to handle appointments for muliple resources](https://www.syncfusion.com/kb/11812/how-to-handle-appointments-for-multiple-resources-in-the-flutter-calendar)
///
/// ```dart
/// @override
@@ -708,7 +911,11 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.recurrenceId].
+ /// See also:
+ /// * [Appointment.recurrenceId], which used to handle the changed or
+ /// exception occurrence appointments in calendar.
+ /// * [getId], which used to map the custom appointment's [Appointment.id]
+ /// property of the [Appointment].
///
/// ```dart
/// @override
@@ -726,7 +933,11 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// _Note:_ It is applicable only when the custom appointments set to the
/// [appointments].
///
- /// See also: [Appointment.id].
+ /// See also:
+ /// * [Appointment.id], which holds an unique identification number for the
+ /// appointment in the calendar.
+ /// * [getRecurrenceRule], which used to map the custom appointment's
+ /// [Appointment.recurrenceRule] property to the [Appointment].
///
/// ```dart
/// @override
@@ -736,11 +947,64 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// ```
Object? getId(int index) => null;
+ /// Converts the [Appointment] data to the custom business object data.
+ ///
+ /// Note_:_ When business object used to set data for [SfCalendar], this
+ /// method must be implemented to get the data with business object type when
+ /// drag and drop and appointment resizing enabled.
+ ///
+ /// ```dart
+ ///
+ ///class _DataSource extends CalendarDataSource<_Meeting> {
+ /// _DataSource(List<_Meeting> source) {
+ /// appointments = source;
+ /// }
+ ///
+ /// @override
+ /// DateTime getStartTime(int index) {
+ /// return appointments![index].from as DateTime;
+ /// }
+ ///
+ /// @override
+ /// DateTime getEndTime(int index) {
+ /// return appointments![index].to as DateTime;
+ /// }
+ ///
+ /// @override
+ /// String getSubject(int index) {
+ /// return appointments![index].content as String;
+ /// }
+ ///
+ /// @override
+ /// Color getColor(int index) {
+ /// return appointments![index].background as Color;
+ /// }
+ ///
+ /// @override
+ /// _Meeting convertAppointmentToObject(
+ /// _Meeting customData, Appointment appointment) {
+ /// return _Meeting(
+ /// from: appointment.startTime,
+ /// to: appointment.endTime,
+ /// content: appointment.subject,
+ /// background: appointment.color,
+ /// isAllDay: appointment.isAllDay);
+ /// }
+ /// }
+ ///
+ /// ```
+ T? convertAppointmentToObject(T customData, Appointment appointment) => null;
+
/// Called when loadMoreAppointments function is called from the
/// loadMoreWidgetBuilder.
/// Call the [notifyListeners] to notify the calendar for data source changes.
///
- /// See also: [SfCalendar.loadMoreWidgetBuilder]
+ /// See also:
+ /// * [SfCalendar.loadMoreWidgetBuilder], which used to set custom widget,
+ /// which will be displayed when the appointment is loading on view.
+ /// * [notifyListeners], to add, remove or reset the appointment and resource
+ /// collection.
+ /// * Knowledge base: [How to load appointments on demand](https://www.syncfusion.com/kb/12658/how-to-load-appointments-on-demand-in-flutter-calendar)
///
/// ```dart
/// @override
@@ -778,7 +1042,9 @@ abstract class CalendarDataSource extends CalendarDataSourceChangeNotifier {
/// Signature for callback that reports that a appointment collection set to the
/// [CalendarDataSource] modified.
///
-/// See also: [CalendarDataSourceAction]
+/// See also:
+/// [CalendarDataSourceAction], the actions which can be performed using the
+/// calendar.
typedef CalendarDataSourceCallback = void Function(
CalendarDataSourceAction, List);
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/month_appointment_helper.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/month_appointment_helper.dart
index 40596647b..3156cc8da 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/month_appointment_helper.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/month_appointment_helper.dart
@@ -4,6 +4,7 @@ import 'package:syncfusion_flutter_core/core.dart';
import '../common/calendar_view_helper.dart';
import 'appointment_helper.dart';
+// ignore: avoid_classes_with_only_static_members
/// Holds the static helper methods used for appointment rendering in calendar
/// month view.
class MonthAppointmentHelper {
@@ -249,8 +250,12 @@ class MonthAppointmentHelper {
/// swap list index value.
/// Eg., app1 start with Nov3 10AM and ends with Nov5 11AM and app2 starts
/// with Nov3 9AM and ends with Nov4 11AM then swap the app1 before of app2.
- return (startTime2.difference(endTime2).inMinutes.abs())
- .compareTo(startTime1.difference(endTime1).inMinutes.abs());
+ return (AppointmentHelper.getDifference(endTime2, startTime2)
+ .inMinutes
+ .abs())
+ .compareTo(AppointmentHelper.getDifference(endTime1, startTime1)
+ .inMinutes
+ .abs());
}
static void _updateAppointmentPosition(
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/recurrence_helper.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/recurrence_helper.dart
index 949e92566..b1d0e2d84 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/recurrence_helper.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/recurrence_helper.dart
@@ -6,6 +6,7 @@ import '../common/enums.dart' show RecurrenceType, RecurrenceRange, WeekDays;
import 'appointment_helper.dart';
import 'recurrence_properties.dart';
+// ignore: avoid_classes_with_only_static_members
/// Holds the static helper methods used for handling recurrence in calendar.
class RecurrenceHelper {
/// Check the recurrence appointment in between the visible date range.
@@ -130,8 +131,9 @@ class RecurrenceHelper {
/// Total days difference between the visible start date and recurrence
/// start date.
- final int difference =
- visibleInitialDate.difference(recurrenceInitialDate).inDays;
+ final int difference = AppointmentHelper.getDifference(
+ recurrenceInitialDate, visibleInitialDate)
+ .inDays;
final int dayDifference = difference % dailyDayGap;
/// Valid recurrences in between the visible start date and recurrence
@@ -441,7 +443,8 @@ class RecurrenceHelper {
/// Calculate the total days between the recurrence start and visible
/// start date.
- int daysDifference = specificStartDate.difference(startDate).inDays;
+ int daysDifference =
+ AppointmentHelper.getDifference(startDate, specificStartDate).inDays;
final DateTime recurrenceEndDate = addDate.add(recurrenceDuration);
/// Calculate day difference between the recurrence start and end date.
@@ -731,7 +734,7 @@ class RecurrenceHelper {
}
} else if (byDay == 'BYDAY') {
int tempCount = 0;
- final int nthWeekDay = _getWeekDay(byDayValue);
+ final int nthWeekDay = _getWeekDay(byDayValue) % DateTime.daysPerWeek;
final int bySetPosValue = int.parse(bySetPosCount);
void _updateValidDate() {
@@ -946,7 +949,7 @@ class RecurrenceHelper {
int tempCount = 0;
final int monthIndex = int.parse(byMonthCount);
final int bySetPosValue = int.parse(bySetPosCount);
- final int nthWeekDay = _getWeekDay(byDayValue);
+ final int nthWeekDay = _getWeekDay(byDayValue) % DateTime.daysPerWeek;
void _updateValidNextDate() {
while (true) {
@@ -1323,7 +1326,8 @@ class RecurrenceHelper {
if (dayKey.isNotEmpty) {
if (count != 0) {
- final Duration tempTimeSpan = addDate.difference(prevDate);
+ final Duration tempTimeSpan =
+ AppointmentHelper.getDifference(prevDate, addDate);
if (tempTimeSpan <= diffTimeSpan) {
isValidRecurrence = false;
} else {
@@ -1492,14 +1496,15 @@ class RecurrenceHelper {
rRule = rRule + ';UNTIL=' + format.format(endDate!);
}
- if (DateTime(
+ if (AppointmentHelper.getDifference(
+ startDate,
+ DateTime(
startDate.year,
startDate.month + recurrenceProperties.interval,
startDate.day,
startDate.hour,
startDate.minute,
- startDate.second)
- .difference(startDate) <
+ startDate.second)) <
diffTimeSpan) {
isValidRecurrence = false;
}
@@ -1567,14 +1572,15 @@ class RecurrenceHelper {
rRule = rRule + ';UNTIL=' + format.format(endDate!);
}
- if (DateTime(
+ if (AppointmentHelper.getDifference(
+ startDate,
+ DateTime(
startDate.year + recurrenceProperties.interval,
startDate.month,
startDate.day,
startDate.hour,
startDate.minute,
- startDate.second)
- .difference(startDate) <
+ startDate.second)) <
diffTimeSpan) {
isValidRecurrence = false;
}
@@ -1597,7 +1603,8 @@ class RecurrenceHelper {
? appStartTime
: recPropStartDate;
final DateTime? endDate = recPropEndDate;
- final Duration diffTimeSpan = appEndTime.difference(appStartTime);
+ final Duration diffTimeSpan =
+ AppointmentHelper.getDifference(appStartTime, appEndTime);
int recCount = 0;
final DateTime prevDate = DateTime.utc(1);
const bool isValidRecurrence = true;
@@ -1818,7 +1825,7 @@ class RecurrenceHelper {
/// Returns the last week date for the given weekday.
static DateTime _getLastWeekDay(DateTime date, int dayOfWeek) {
final DateTime currentDate = date;
- final int currentDateWeek = currentDate.weekday;
+ final int currentDateWeek = currentDate.weekday % DateTime.daysPerWeek;
int otherMonthCount = -currentDateWeek + (dayOfWeek - DateTime.daysPerWeek);
if (otherMonthCount.abs() >= DateTime.daysPerWeek) {
otherMonthCount += DateTime.daysPerWeek;
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/recurrence_properties.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/recurrence_properties.dart
index 095c0a482..d805255fc 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/recurrence_properties.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_engine/recurrence_properties.dart
@@ -12,6 +12,20 @@ import '../common/enums.dart';
/// [Appointment.recurrenceRule] for [Appointment] using the
/// [SfCalendar.generateRRule] method.
///
+/// See more:
+/// * [Appointment.recurrenceRule], which used to recur the appointment based
+/// on the given rule.
+/// * [SfCalendar.generateRRule], which used to generate recurrence rule
+/// based on the [RecurrenceProperties] values.
+/// * [SfCalendar.parseRRule], which used to get the recurrence properties
+/// based on the given recurrence rule.
+/// * [SfCalendar.getRecurrenceDateTimeCollection], to get the recurrence date
+/// time collection based on the given recurrence rule and start date.
+/// * Knowledge base: [How to use a negative value for bysetpos in rrule](https://www.syncfusion.com/kb/12552/how-to-use-a-negative-value-for-bysetpos-in-a-rrule-of-recurrence-appointment-in-the)
+/// * Knowledge base: [How to get the recurrence date collection](https://www.syncfusion.com/kb/12344/how-to-get-the-recurrence-date-collection-in-the-flutter-calendar)
+/// * Knowledge base: [How to add recurring appointments until specified date](https://www.syncfusion.com/kb/12158/how-to-add-recurring-appointments-until-the-specified-date-in-the-flutter-calendar)
+/// * Knowledge base: [How to get the recurrence properties from recurrence rule](https://www.syncfusion.com/kb/12370/how-to-get-the-recurrence-properties-from-rrule-in-the-flutter-calendar)
+///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -87,7 +101,8 @@ class RecurrenceProperties with Diagnosticable {
///
/// Defaults to `RecurrenceType.daily`.
///
- /// Also refer: [RecurrenceType].
+ /// Also refer:
+ /// * [RecurrenceType], to know more about the available recurrence types.
///
/// ```dart
///Widget build(BuildContext context) {
@@ -143,6 +158,9 @@ class RecurrenceProperties with Diagnosticable {
/// _Note:_ It is applicable only when the [recurrenceRange] set as
/// [RecurrenceRange.count].
///
+ /// See also:
+ /// * [recurrenceRange], to define the range for the recurring event.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -190,6 +208,9 @@ class RecurrenceProperties with Diagnosticable {
///
/// The [Appointment] starts to recur from the date set to this property.
///
+ /// See also:
+ /// * [endDate], on which date the recurring event will end.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -242,7 +263,10 @@ class RecurrenceProperties with Diagnosticable {
/// _Note:_ it is applicable only when the [recurrenceRange] set as
/// [RecurrenceRange.endDate].
///
- /// Defaults to the next date of current date.
+ /// Defaults to null.
+ ///
+ /// See also:
+ /// * [startDate], on or after the given date the recurring will be start.
///
/// ```dart
///Widget build(BuildContext context) {
@@ -294,6 +318,10 @@ class RecurrenceProperties with Diagnosticable {
///
/// Defaults to `1`.
///
+ /// See also:
+ /// * [recurrenceType], to define the recurrent type for the event.
+ /// * [recurrenceRange], to define the range for the recurring event.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -341,7 +369,9 @@ class RecurrenceProperties with Diagnosticable {
///
/// Defaults to `RecurrenceRange.noEndDate`.
///
- /// Also refer: [RecurrenceRange].
+ /// Also refer:
+ /// * [RecurrenceRange], to know more about the available recurrence range in
+ /// calendar.
///
/// ```dart
///Widget build(BuildContext context) {
@@ -391,6 +421,11 @@ class RecurrenceProperties with Diagnosticable {
/// The [Appointment] will recur on the [WeekDays] set to this property,
/// when the [recurrenceType] set as [RecurrenceType.weekly].
///
+ /// See also:
+ /// * [WeekDays], to know more about the available week days to define.
+ /// * [recurrenceType], which used to define the the type of the recurring
+ /// event.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -444,6 +479,11 @@ class RecurrenceProperties with Diagnosticable {
/// The [Appointment] will recur on the [Week] set to this property,
/// when the [recurrenceType] set as [RecurrenceType.year].
///
+ /// See also:
+ /// * [recurrenceType], which used to define the the type of the recurring
+ /// event.
+ /// * Knowledge base: [How to use a negative value for bysetpos in rrule](https://www.syncfusion.com/kb/12552/how-to-use-a-negative-value-for-bysetpos-in-a-rrule-of-recurrence-appointment-in-the)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -492,6 +532,10 @@ class RecurrenceProperties with Diagnosticable {
/// The [Appointment] will recur on the day set to this property on specific
/// month, when the [recurrenceType] set as [RecurrenceType.year].
///
+ /// See also:
+ /// * [recurrenceType], which used to define the the type of the recurring
+ /// event.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -541,6 +585,10 @@ class RecurrenceProperties with Diagnosticable {
/// week, when the [recurrenceType] set as [RecurrenceType.year] or
/// [RecurrenceType.month].
///
+ /// See also:
+ /// * [recurrenceType], which used to define the the type of the recurring
+ /// event.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -592,6 +640,10 @@ class RecurrenceProperties with Diagnosticable {
/// The [Appointment] will recur on the month set to this property on specific
/// year, when the [recurrenceType] set as [RecurrenceType.year].
///
+ /// See also:
+ /// * [recurrenceType], which used to define the the type of the recurring
+ /// event.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/agenda_view_layout.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/agenda_view_layout.dart
index 38eed9c53..4b033a667 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/agenda_view_layout.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/agenda_view_layout.dart
@@ -7,6 +7,7 @@ import 'package:syncfusion_flutter_core/core.dart';
import 'package:syncfusion_flutter_core/localizations.dart';
import 'package:syncfusion_flutter_core/theme.dart';
+import '../../../calendar.dart';
import '../appointment_engine/appointment_helper.dart';
import '../common/calendar_view_helper.dart';
import '../common/event_args.dart';
@@ -33,7 +34,8 @@ class AgendaViewLayout extends StatefulWidget {
this.isMobilePlatform,
this.appointmentBuilder,
this.width,
- this.height);
+ this.height,
+ this.calendar);
/// Defines the month view customization details.
final MonthViewSettings? monthViewSettings;
@@ -84,6 +86,9 @@ class AgendaViewLayout extends StatefulWidget {
/// Defines the height of the agenda appointment layout widget.
final double height;
+ /// Defines the calendar widget.
+ final SfCalendar calendar;
+
@override
_AgendaViewLayoutState createState() => _AgendaViewLayoutState();
}
@@ -132,7 +137,8 @@ class _AgendaViewLayoutState extends State {
final CalendarAppointmentDetails details = CalendarAppointmentDetails(
widget.selectedDate!,
List.unmodifiable([
- CalendarViewHelper.getAppointmentDetail(view.appointment!)
+ CalendarViewHelper.getAppointmentDetail(
+ view.appointment!, widget.calendar.dataSource)
]),
view.appointmentRect!.outerRect);
final Widget child = widget.appointmentBuilder!(context, details);
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/allday_appointment_layout.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/allday_appointment_layout.dart
index bde90cc7d..bda57e944 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/allday_appointment_layout.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/allday_appointment_layout.dart
@@ -169,7 +169,7 @@ class _AllDayAppointmentLayoutState extends State {
date,
List.unmodifiable([
CalendarViewHelper.getAppointmentDetail(
- appointmentView.appointment!)
+ appointmentView.appointment!, widget.calendar.dataSource)
]),
Rect.fromLTWH(
appointmentView.appointmentRect!.left,
@@ -190,9 +190,11 @@ class _AllDayAppointmentLayoutState extends State {
final double cellWidth =
(widget.width - widget.timeLabelWidth) / widget.visibleDates.length;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ widget.calendar.cellEndPadding, widget.isMobilePlatform);
+
/// Calculate the maximum appointment width based on cell end padding.
- final double maxAppointmentWidth =
- cellWidth - widget.calendar.cellEndPadding;
+ final double maxAppointmentWidth = cellWidth - cellEndPadding;
for (int i = 0; i < keys.length; i++) {
final int index = keys[i];
final DateTime date = widget.visibleDates[index];
@@ -213,7 +215,8 @@ class _AllDayAppointmentLayoutState extends State {
CalendarAppointmentDetails(
date,
List.unmodifiable(
- CalendarViewHelper.getCustomAppointments(moreAppointments)),
+ CalendarViewHelper.getCustomAppointments(
+ moreAppointments, widget.calendar.dataSource)),
Rect.fromLTWH(
widget.isRTL
? widget.width - xPosition - maxAppointmentWidth
@@ -270,6 +273,9 @@ class _AllDayAppointmentLayoutState extends State {
? 2
: kAllDayAppointmentHeight * 0.1;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ widget.calendar.cellEndPadding, widget.isMobilePlatform);
+
/// Calculate the maximum position of the appointment this widget can hold.
final int position = widget.allDayPainterHeight ~/ kAllDayAppointmentHeight;
for (int i = 0; i < _appointmentCollection.length; i++) {
@@ -284,7 +290,7 @@ class _AllDayAppointmentLayoutState extends State {
Rect.fromLTRB(
((widget.visibleDates.length - appointmentView.endIndex) *
cellWidth) +
- widget.calendar.cellEndPadding,
+ cellEndPadding,
(kAllDayAppointmentHeight * appointmentView.position)
.toDouble(),
(widget.visibleDates.length - appointmentView.startIndex) *
@@ -303,7 +309,7 @@ class _AllDayAppointmentLayoutState extends State {
.toDouble(),
(appointmentView.endIndex * cellWidth) +
widget.timeLabelWidth -
- widget.calendar.cellEndPadding,
+ cellEndPadding,
((kAllDayAppointmentHeight * appointmentView.position) +
kAllDayAppointmentHeight -
1)
@@ -838,6 +844,8 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
}
_cellWidth = (size.width - timeLabelWidth) / visibleDates.length;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ calendar.cellEndPadding, isMobilePlatform);
final List keys = moreAppointmentIndex.keys.toList();
for (int i = 0; i < keys.length; i++) {
if (child == null) {
@@ -846,8 +854,7 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
final int index = keys[i];
final double leftPosition = isRTL
- ? ((visibleDates.length - index - 1) * _cellWidth) +
- calendar.cellEndPadding
+ ? ((visibleDates.length - index - 1) * _cellWidth) + cellEndPadding
: timeLabelWidth + (index * _cellWidth);
final Offset offset = Offset(leftPosition, maximumBottomPosition);
final bool isHit = result.addWithPaintOffset(
@@ -923,7 +930,9 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
_cellWidth = (size.width - timeLabelWidth) / visibleDates.length;
const double appointmentHeight = kAllDayAppointmentHeight - 1;
- final double maxAppointmentWidth = _cellWidth - calendar.cellEndPadding;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ calendar.cellEndPadding, isMobilePlatform);
+ final double maxAppointmentWidth = _cellWidth - cellEndPadding;
final List keys = moreAppointmentIndex.keys.toList();
for (int i = 0; i < keys.length; i++) {
if (child == null) {
@@ -939,8 +948,7 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
child.parentData! as CalendarParentData;
final int index = keys[i];
final double leftPosition = isRTL
- ? ((visibleDates.length - index - 1) * _cellWidth) +
- calendar.cellEndPadding
+ ? ((visibleDates.length - index - 1) * _cellWidth) + cellEndPadding
: timeLabelWidth + (index * _cellWidth);
childParentData.offset = Offset(leftPosition, maximumBottomPosition);
child = childAfter(child);
@@ -950,6 +958,7 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
@override
void paint(PaintingContext context, Offset offset) {
_textPainter.textScaleFactor = _textScaleFactor;
+ double leftPosition = 0, rightPosition = size.width;
if (view == CalendarView.day) {
_rectPainter.strokeWidth = 0.5;
_rectPainter.color =
@@ -964,7 +973,27 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
isRTL ? size.width - timeLabelWidth + 0.5 : timeLabelWidth - 0.5,
size.height),
_rectPainter);
+
+ leftPosition = isRTL ? 0 : timeLabelWidth;
+ rightPosition = isRTL ? size.width - timeLabelWidth : size.width;
+
+ final double viewHeaderHeight = CalendarViewHelper.getViewHeaderHeight(
+ calendar.viewHeaderHeight, view);
+ _rectPainter.color = calendar.timeSlotViewSettings.allDayPanelColor ??
+ calendarTheme.allDayPanelColor!;
+ context.canvas.drawRect(
+ Rect.fromLTRB(
+ isRTL ? size.width - timeLabelWidth : 0,
+ viewHeaderHeight,
+ isRTL ? size.width : timeLabelWidth,
+ size.height),
+ _rectPainter);
}
+ _rectPainter.color = calendar.timeSlotViewSettings.allDayPanelColor ??
+ calendarTheme.allDayPanelColor!;
+ context.canvas.drawRect(
+ Rect.fromLTRB(leftPosition, 0, rightPosition, size.height),
+ _rectPainter);
_rectPainter.isAntiAlias = true;
_cellWidth = (size.width - timeLabelWidth) / visibleDates.length;
@@ -1127,6 +1156,8 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
if (child != null) {
final double endYPosition =
allDayPainterHeight - kAllDayAppointmentHeight;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ calendar.cellEndPadding, isMobilePlatform);
final List keys = moreAppointmentIndex.keys.toList();
for (final int index in keys) {
if (child == null) {
@@ -1135,7 +1166,7 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
final double xPosition = isRTL
? ((visibleDates.length - index - 1) * _cellWidth) +
- calendar.cellEndPadding
+ cellEndPadding
: timeLabelWidth + (index * _cellWidth);
context.paintChild(child, Offset(xPosition, endYPosition));
child = childAfter(child);
@@ -1316,6 +1347,8 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
final int index = DateTimeHelper.getIndex(
visibleDates, selectionNotifier.value!.selectedDate!);
Decoration? selectionDecoration = calendar.selectionDecoration;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ calendar.cellEndPadding, isMobilePlatform);
/// Set the default selection decoration background color with opacity
/// value based on theme brightness when selected date hold all day
@@ -1352,13 +1385,10 @@ class _AllDayAppointmentRenderObject extends CustomCalendarRenderObject {
double xValue = timeLabelWidth + (index * _cellWidth);
if (isRTL) {
xValue = size.width - xValue - _cellWidth;
- rect = Rect.fromLTRB(xValue + calendar.cellEndPadding, 0,
- xValue + _cellWidth, kAllDayAppointmentHeight - 1);
+ rect = Rect.fromLTRB(xValue + cellEndPadding, 0, xValue + _cellWidth,
+ kAllDayAppointmentHeight - 1);
} else {
- rect = Rect.fromLTRB(
- xValue,
- 0,
- xValue + _cellWidth - calendar.cellEndPadding,
+ rect = Rect.fromLTRB(xValue, 0, xValue + _cellWidth - cellEndPadding,
kAllDayAppointmentHeight - 1);
}
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/appointment_layout.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/appointment_layout.dart
index cb7dfda0e..a0b1734a3 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/appointment_layout.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/appointment_layout/appointment_layout.dart
@@ -218,7 +218,7 @@ class _AppointmentLayoutState extends State {
date,
List.unmodifiable([
CalendarViewHelper.getAppointmentDetail(
- appointmentView.appointment!)
+ appointmentView.appointment!, widget.calendar.dataSource)
]),
Rect.fromLTWH(
appointmentView.appointmentRect!.left,
@@ -257,7 +257,7 @@ class _AppointmentLayoutState extends State {
date,
List.unmodifiable(
CalendarViewHelper.getCustomAppointments(
- moreAppointments)),
+ moreAppointments, widget.calendar.dataSource)),
Rect.fromLTWH(moreRegionRect.left, moreRegionRect.top,
moreRegionRect.width, moreRegionRect.height),
isMoreAppointmentRegion: true));
@@ -528,7 +528,8 @@ class _AppointmentLayoutState extends State {
(cellHeight - startPosition) / maximumDisplayCount;
// right side padding used to add padding on appointment view right side
// in month view
- final double cellEndPadding = widget.calendar.cellEndPadding;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ widget.calendar.cellEndPadding, widget.isMobilePlatform);
for (int i = 0; i < _appointmentCollection.length; i++) {
final AppointmentView appointmentView = _appointmentCollection[i];
if (appointmentView.canReuse || appointmentView.appointment == null) {
@@ -632,7 +633,8 @@ class _AppointmentLayoutState extends State {
final double cellWidth = width / count;
final double cellHeight = widget.timeIntervalHeight;
double xPosition = timeLabelWidth;
- final double cellEndPadding = widget.calendar.cellEndPadding;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ widget.calendar.cellEndPadding, widget.isMobilePlatform);
final int timeInterval = CalendarViewHelper.getTimeInterval(
widget.calendar.timeSlotViewSettings);
@@ -660,7 +662,10 @@ class _AppointmentLayoutState extends State {
if (column == -1 ||
appointment.isSpanned ||
- (appointment.endTime.difference(appointment.startTime).inDays > 0) ||
+ AppointmentHelper.getDifference(
+ appointment.startTime, appointment.endTime)
+ .inDays >
+ 0 ||
appointment.isAllDay) {
continue;
}
@@ -681,11 +686,10 @@ class _AppointmentLayoutState extends State {
timeLabelWidth;
}
- Duration difference =
- appointment.actualEndTime.difference(appointment.actualStartTime);
+ Duration difference = AppointmentHelper.getDifference(
+ appointment.actualStartTime, appointment.actualEndTime);
final double minuteHeight = cellHeight / timeInterval;
double yPosition = totalMins * minuteHeight;
-
double height = difference.inMinutes * minuteHeight;
if (widget.calendar.timeSlotViewSettings.minimumAppointmentDuration !=
null &&
@@ -793,7 +797,8 @@ class _AppointmentLayoutState extends State {
final double cellWidth = widget.timeIntervalHeight;
double xPosition = 0;
double yPosition = 0;
- final double cellEndPadding = widget.calendar.cellEndPadding;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ widget.calendar.cellEndPadding, widget.isMobilePlatform);
final double slotHeight =
isResourceEnabled ? widget.resourceItemHeight! : widget.height;
final double timelineAppointmentHeight = _getTimelineAppointmentHeight(
@@ -842,7 +847,8 @@ class _AppointmentLayoutState extends State {
}
final DateTime endTime = appointment.actualEndTime;
- final Duration difference = endTime.difference(startTime);
+ final Duration difference =
+ AppointmentHelper.getDifference(startTime, endTime);
/// The width for the appointment UI, calculated based on the date
/// difference between the start and end time of the appointment.
@@ -914,15 +920,17 @@ class _AppointmentLayoutState extends State {
double yPosition = 0;
final int timeInterval = CalendarViewHelper.getTimeInterval(
widget.calendar.timeSlotViewSettings);
- final double cellEndPadding = widget.calendar.cellEndPadding;
+ final double cellEndPadding = CalendarViewHelper.getCellEndPadding(
+ widget.calendar.cellEndPadding, widget.isMobilePlatform);
final int viewStartHour =
widget.calendar.timeSlotViewSettings.startHour.toInt();
final double viewStartMinutes =
(widget.calendar.timeSlotViewSettings.startHour - viewStartHour) * 60;
final double timelineAppointmentHeight = _getTimelineAppointmentHeight(
widget.calendar.timeSlotViewSettings, widget.view);
- final double slotHeight =
- isResourceEnabled ? widget.resourceItemHeight! : widget.height;
+ final double slotHeight = isResourceEnabled
+ ? widget.resourceItemHeight! - cellEndPadding
+ : widget.height - cellEndPadding;
for (int i = 0; i < _appointmentCollection.length; i++) {
final AppointmentView appointmentView = _appointmentCollection[i];
if (appointmentView.canReuse || appointmentView.appointment == null) {
@@ -1031,8 +1039,8 @@ class _AppointmentLayoutState extends State {
if (widget.calendar.timeSlotViewSettings.minimumAppointmentDuration !=
null &&
widget.calendar.timeSlotViewSettings.minimumAppointmentDuration! >
- appointment.actualEndTime
- .difference(appointment.actualStartTime)) {
+ AppointmentHelper.getDifference(
+ appointment.actualStartTime, appointment.actualEndTime)) {
final double minWidth =
AppointmentHelper.getAppointmentHeightFromDuration(
widget.calendar.timeSlotViewSettings.minimumAppointmentDuration,
@@ -1041,15 +1049,12 @@ class _AppointmentLayoutState extends State {
width = width > minWidth ? width : minWidth;
}
- width = width - cellEndPadding;
final Radius cornerRadius = Radius.circular(
(appointmentHeight * 0.1) > 2 ? 2 : (appointmentHeight * 0.1));
+ width = width > 1 ? width - 1 : 0;
final RRect rect = RRect.fromRectAndRadius(
- Rect.fromLTWH(
- widget.isRTL ? xPosition - width : xPosition,
- yPosition,
- width > 0 ? width : 0,
- appointmentHeight > 1 ? appointmentHeight - 1 : 0),
+ Rect.fromLTWH(widget.isRTL ? xPosition - width : xPosition, yPosition,
+ width, appointmentHeight > 1 ? appointmentHeight - 1 : 0),
cornerRadius);
appointmentView.appointmentRect = rect;
}
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/common/calendar_view_helper.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/common/calendar_view_helper.dart
index 83bee303d..0faa2513f 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/common/calendar_view_helper.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/common/calendar_view_helper.dart
@@ -7,6 +7,7 @@ import 'package:syncfusion_flutter_core/core.dart';
import 'package:syncfusion_flutter_core/theme.dart';
import '../../../calendar.dart';
+import '../appointment_engine/appointment_helper.dart';
import '../appointment_engine/calendar_datasource.dart';
import '../resource_view/calendar_resource.dart';
import '../settings/month_view_settings.dart';
@@ -45,6 +46,7 @@ typedef UpdateCalendarState = void Function(
//// the given width agenda view will render the web UI.
const double _kMobileViewWidth = 767;
+// ignore: avoid_classes_with_only_static_members
/// Holds the static helper methods used for calendar views rendering
/// in calendar.
class CalendarViewHelper {
@@ -259,7 +261,10 @@ class CalendarViewHelper {
if (appointment.isAllDay) {
return appointment.subject + 'All day';
} else if (appointment.isSpanned ||
- appointment.endTime.difference(appointment.startTime).inDays > 0) {
+ AppointmentHelper.getDifference(
+ appointment.startTime, appointment.endTime)
+ .inDays >
+ 0) {
return appointment.subject +
DateFormat('hh mm a dd/MMMM/yyyy')
.format(appointment.startTime)
@@ -433,6 +438,19 @@ class CalendarViewHelper {
}
}
+ /// Return the cell end padding based on platform of calendar widget.
+ static double getCellEndPadding(double cellEndPadding, bool isMobile) {
+ if (cellEndPadding != -1) {
+ return cellEndPadding;
+ }
+
+ if (isMobile) {
+ return 3;
+ }
+
+ return 6;
+ }
+
/// method to check whether the view changed callback can triggered or not.
static bool shouldRaiseViewChangedCallback(
ViewChangedCallback? onViewChanged) {
@@ -456,6 +474,27 @@ class CalendarViewHelper {
return onSelectionChanged != null;
}
+ /// Method to check whether the appointment resize start callback can trigger
+ /// or not.
+ static bool shouldRaiseAppointmentResizeStartCallback(
+ AppointmentResizeStartCallback? onAppointmentResizeStart) {
+ return onAppointmentResizeStart != null;
+ }
+
+ /// Method to check whether the appointment resize update callback can trigger
+ /// or not.
+ static bool shouldRaiseAppointmentResizeUpdateCallback(
+ AppointmentResizeUpdateCallback? onAppointmentResizeUpdate) {
+ return onAppointmentResizeUpdate != null;
+ }
+
+ /// Method to check whether the appointment resize end callback can trigger
+ /// or not.
+ static bool shouldRaiseAppointmentResizeEndCallback(
+ AppointmentResizeEndCallback? onAppointmentResizeEnd) {
+ return onAppointmentResizeEnd != null;
+ }
+
/// method that raise the calendar tapped callback with the given parameters
static void raiseCalendarTapCallback(
SfCalendar calendar,
@@ -491,6 +530,38 @@ class CalendarViewHelper {
calendar.onViewChanged!(ViewChangedDetails(visibleDates));
}
+ /// Method that raises the appointment resize start callback with the given
+ /// parameters.
+ static void raiseAppointmentResizeStartCallback(
+ SfCalendar calendar, dynamic appointment, CalendarResource? resource) {
+ calendar.onAppointmentResizeStart!(
+ AppointmentResizeStartDetails(appointment, resource));
+ }
+
+ /// Method that raises the appointment resize update callback with the given
+ /// parameters.
+ static void raiseAppointmentResizeUpdateCallback(
+ SfCalendar calendar,
+ dynamic appointment,
+ CalendarResource? resource,
+ DateTime? resizingTime,
+ Offset resizingOffset) {
+ calendar.onAppointmentResizeUpdate!(AppointmentResizeUpdateDetails(
+ appointment, resource, resizingTime, resizingOffset));
+ }
+
+ /// Method that raises the appointment resize end callback with the given
+ /// parameters.
+ static void raiseAppointmentResizeEndCallback(
+ SfCalendar calendar,
+ dynamic appointment,
+ CalendarResource? resource,
+ DateTime? startTime,
+ DateTime? endTime) {
+ calendar.onAppointmentResizeEnd!(
+ AppointmentResizeEndDetails(appointment, resource, startTime, endTime));
+ }
+
/// Check the calendar view is timeline view or not.
static bool isTimelineView(CalendarView view) {
switch (view) {
@@ -511,24 +582,33 @@ class CalendarViewHelper {
/// converts the given schedule appointment collection to their custom
/// appointment collection
static List getCustomAppointments(
- List? appointments) {
+ List? appointments, CalendarDataSource? dataSource) {
final List customAppointments = [];
if (appointments == null) {
return customAppointments;
}
for (int i = 0; i < appointments.length; i++) {
- customAppointments.add(getAppointmentDetail(appointments[i]));
+ customAppointments.add(getAppointmentDetail(appointments[i], dataSource));
}
return customAppointments;
}
/// Returns the appointment details with given appointment type.
- static dynamic getAppointmentDetail(CalendarAppointment appointment) {
+ static dynamic getAppointmentDetail(
+ CalendarAppointment appointment, CalendarDataSource? dataSource) {
if (appointment.recurrenceRule != null &&
appointment.recurrenceRule!.isNotEmpty) {
- return appointment.convertToCalendarAppointment();
+ final Appointment appointmentObject =
+ appointment.convertToCalendarAppointment();
+ if (appointment.data is Appointment) {
+ return appointmentObject;
+ } else {
+ return dataSource!.convertAppointmentToObject(
+ appointment.data, appointmentObject) ??
+ appointmentObject;
+ }
} else {
return appointment.data;
}
@@ -699,6 +779,20 @@ class AppointmentView {
/// Defines the resource view index of the appointment.
int resourceIndex = -1;
+
+ /// Clones and return new instance of the appointment view.
+ AppointmentView clone() {
+ return AppointmentView()
+ ..appointmentRect = appointmentRect
+ ..appointment = appointment
+ ..canReuse = canReuse
+ ..startIndex = startIndex
+ ..endIndex = endIndex
+ ..position = position
+ ..maxPositions = maxPositions
+ ..isSpanned = isSpanned
+ ..resourceIndex = resourceIndex;
+ }
}
/// Appointment data for calendar.
@@ -863,6 +957,7 @@ class CalendarAppointment {
if (other is CalendarAppointment) {
otherAppointment = other;
}
+
return CalendarViewHelper.isSameTimeSlot(
otherAppointment.startTime, startTime) &&
CalendarViewHelper.isSameTimeSlot(otherAppointment.endTime, endTime) &&
@@ -876,11 +971,14 @@ class CalendarAppointment {
otherAppointment.isAllDay == isAllDay &&
otherAppointment.notes == notes &&
otherAppointment.location == location &&
- otherAppointment.resourceIds == resourceIds &&
+ !CalendarViewHelper.isCollectionEqual(
+ otherAppointment.resourceIds, resourceIds) &&
otherAppointment.recurrenceId == recurrenceId &&
- otherAppointment.id == otherAppointment.id &&
+ otherAppointment.id == id &&
+ otherAppointment.data == data &&
otherAppointment.subject == subject &&
otherAppointment.color == color &&
+ otherAppointment.recurrenceRule == recurrenceRule &&
CalendarViewHelper.isDateCollectionEqual(
otherAppointment.recurrenceExceptionDates,
recurrenceExceptionDates);
@@ -899,6 +997,7 @@ class CalendarAppointment {
hashList(resourceIds),
recurrenceId,
id,
+ data,
startTime,
endTime,
subject,
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/common/date_time_engine.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/common/date_time_engine.dart
index a5891fd90..9bb1c7044 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/common/date_time_engine.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/common/date_time_engine.dart
@@ -1,6 +1,8 @@
import 'package:syncfusion_flutter_core/core.dart';
+import '../appointment_engine/appointment_helper.dart';
import 'enums.dart';
+// ignore: avoid_classes_with_only_static_members
/// Holds the static helper methods used for date calculation in calendar.
class DateTimeHelper {
/// Calculate the visible dates count based on calendar view
@@ -316,7 +318,8 @@ class DateTimeHelper {
/// Returns week number for the given date.
static int getWeekNumberOfYear(DateTime date) {
final DateTime yearEndDate = DateTime(date.year - 1, 12, 31);
- final int dayOfYear = date.difference(yearEndDate).inDays;
+ final int dayOfYear =
+ AppointmentHelper.getDifference(yearEndDate, date).inDays;
int weekNumber = (dayOfYear - date.weekday + 10) ~/ 7;
if (weekNumber < 1) {
weekNumber = getWeeksInYear(date.year - 1);
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/common/enums.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/common/enums.dart
index 2d77a2eec..9b7f01a45 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/common/enums.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/common/enums.dart
@@ -1,4 +1,8 @@
/// A direction in which the [SfCalendar] month view navigates.
+///
+/// See also:
+/// * [ViewNavigationMode], which allows to navigate through calendar views with
+/// different modes.
enum MonthNavigationDirection {
/// - MonthNavigationDirection.vertical, Navigates in top and bottom direction
vertical,
@@ -208,6 +212,10 @@ enum CalendarDataSourceAction {
}
/// Available view navigation modes for [SfCalendar].
+///
+/// See also:
+/// * [MonthNavigationDirection], which used to define the navigation direction
+/// for month view in calendar.
enum ViewNavigationMode {
/// - ViewNavigationMode.snap, allows to switching to previous/next views
/// through swipe interaction in SfCalendar.
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/common/event_args.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/common/event_args.dart
index 54378f1e6..9b8728d53 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/common/event_args.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/common/event_args.dart
@@ -1,6 +1,7 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
+import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../resource_view/calendar_resource.dart';
import '../settings/time_region.dart';
import 'enums.dart';
@@ -8,6 +9,12 @@ import 'enums.dart';
/// The dates that visible on the view changes in [SfCalendar].
///
/// Details for [ViewChangedCallback], such as [visibleDates].
+///
+/// See also:
+/// * [SfCalendar.onViewChanged], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [ViewChangedCallback], signature when the current visible dates changed
+/// in calendar.
@immutable
class ViewChangedDetails {
/// Creates details for [ViewChangedCallback].
@@ -23,7 +30,10 @@ class ViewChangedDetails {
/// [targetElement].
///
/// See also:
-/// [CalendarTapCallback]
+/// * [SfCalendar.onTap], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [CalendarTapCallback], signature when any of the calendar elements
+/// tapped.
@immutable
class CalendarTapDetails extends CalendarTouchDetails {
/// Creates details for [CalendarTapCallback].
@@ -38,7 +48,10 @@ class CalendarTapDetails extends CalendarTouchDetails {
/// [targetElement].
///
/// See also:
-/// [CalendarLongPressCallback]
+/// * [SfCalendar.onLongPress], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [CalendarLongPressCallback], signature when any of the calendar elements
+/// long pressed.
@immutable
class CalendarLongPressDetails extends CalendarTouchDetails {
/// Creates details for [CalendarLongPressCallback]
@@ -53,7 +66,10 @@ class CalendarLongPressDetails extends CalendarTouchDetails {
/// such as [date], and [resource].
///
/// See also:
-/// [CalendarSelectionChangedCallback]
+/// * [SfCalendar.onSelectionChanged], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [CalendarSelectionChangedCallback], signature when any of the selected
+/// cell changed in calendar.
@immutable
class CalendarSelectionDetails {
/// Creates details for [CalendarSelectionChangedCallback].
@@ -72,10 +88,11 @@ class CalendarSelectionDetails {
/// Base class for [CalendarTapDetails] and [CalendarLongPressDetails].
///
/// See also:
-/// [CalendarTapDetails]
-/// [CalendarLongPressDetails]
-/// [CalendarTapCallback]
-/// [CalendarLongPressCallback]
+/// [CalendarTapDetails], to pass the tapped details information.
+/// [CalendarLongPressDetails], to pass the long pressed details information.
+/// [CalendarTapCallback], signature when any calendar element tapped.
+/// [CalendarLongPressCallback], signature when any calendar element is long
+/// pressed.
@immutable
class CalendarTouchDetails {
/// Creates details for [CalendarTapCallback] and [CalendarLongPressCallback].
@@ -96,38 +113,233 @@ class CalendarTouchDetails {
final CalendarResource? resource;
}
+/// The appointment that starts resizing on view in [SfCalendar]
+///
+/// Details for [AppointmentResizeStartCallback], such as [appointment], and
+/// [resource]
+///
+/// See also:
+/// * [SfCalendar.onAppointmentResizeStart], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [AppointmentResizeStartCallback], signature when appointment starts
+/// resizing in calendar.
+class AppointmentResizeStartDetails {
+ /// Creates details for [AppointmentResizeStartCallback].
+ const AppointmentResizeStartDetails(this.appointment, this.resource);
+
+ /// The appointment that starts resizing on view in [SfCalendar].
+ final dynamic appointment;
+
+ /// The resource associated with the resizing appointment in timeline views.
+ final CalendarResource? resource;
+}
+
+/// The appointment that resizing on view in [SfCalendar]
+///
+/// Details for [AppointmentResizeUpdateCallback], such as [appointment],
+/// [resizingTime], [resizingOffset] and [resource].
+///
+/// See also:
+/// * [SfCalendar.onAppointmentResizeUpdate], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [AppointmentResizeUpdateCallback], signature when appointment resizing in
+/// calendar.
+class AppointmentResizeUpdateDetails {
+ /// Creates details for [AppointmentResizeUpdateCallback].
+ const AppointmentResizeUpdateDetails(
+ this.appointment, this.resource, this.resizingTime, this.resizingOffset);
+
+ /// The appointment that resizing on view in [SfCalendar].
+ final dynamic appointment;
+
+ /// The resource associated with the resizing appointment in timeline views.
+ final CalendarResource? resource;
+
+ /// The current resizing time value of the appointment.
+ final DateTime? resizingTime;
+
+ /// The current resize position of the appointment.
+ final Offset? resizingOffset;
+}
+
+/// The appointment that resizing ends on view in [SfCalendar]
+///
+/// Details for [AppointmentResizeEndCallback], such as [appointment],
+/// [startTime], [endTime] and [resource].
+///
+/// See also:
+/// * [SfCalendar.onAppointmentResizeEnd], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [AppointmentResizeEndCallback], signature when appointment resizing ends
+/// in calendar.
+class AppointmentResizeEndDetails {
+ /// Creates details for [AppointmentResizeUpdateCallback].
+ const AppointmentResizeEndDetails(
+ this.appointment, this.resource, this.startTime, this.endTime);
+
+ /// The appointment that resized on view in [SfCalendar].
+ final dynamic appointment;
+
+ /// The resource associated with the rescheduled appointment in timeline
+ /// views.
+ final CalendarResource? resource;
+
+ /// The updated start time of the reschedule appointment.
+ final DateTime? startTime;
+
+ /// The updated end time of the reschedule appointment.
+ final DateTime? endTime;
+}
+
+/// The appointment that starts dragging on view in [SfCalendar]
+///
+/// Details for [AppointmentDragStartCallback], such as [appointment], and
+/// [resource]
+///
+/// See also:
+/// * [SfCalendar.onDragStart], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [AppointmentDragStartCallback], signature when appointment starts
+/// dragging in calendar.
+@immutable
+class AppointmentDragStartDetails {
+ /// Creates details for [AppointmentDragStartCallback].
+ const AppointmentDragStartDetails(this.appointment, this.resource);
+
+ /// The dragging appointment details.
+ final Object? appointment;
+
+ /// The resource of the dragging appointment.
+ final CalendarResource? resource;
+}
+
+/// The appointment that dragging on view in [SfCalendar]
+///
+/// Details for [AppointmentDragUpdateCallback], such as [appointment],
+/// [sourceResource], [targetResource], [draggingPosition] and [draggingTime].
+///
+/// See also:
+/// * [SfCalendar.onDragUpdate], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [AppointmentDragUpdateCallback], signature when appointment dragging in
+/// calendar.
+@immutable
+class AppointmentDragUpdateDetails {
+ /// Creates details for [AppointmentDragUpdateCallback].
+ const AppointmentDragUpdateDetails(this.appointment, this.sourceResource,
+ this.targetResource, this.draggingPosition, this.draggingTime);
+
+ /// The dragging appointment.
+ final Object? appointment;
+
+ /// The source resource of the dragging appointment.
+ final CalendarResource? sourceResource;
+
+ /// The resource in which the appointment dragging.
+ final CalendarResource? targetResource;
+
+ /// The current dragging position.
+ final Offset? draggingPosition;
+
+ /// The current dragging time of the appointment.
+ final DateTime? draggingTime;
+}
+
+/// The appointment that dragging ends on view in [SfCalendar]
+///
+/// Details for [AppointmentDragEndCallback], such as [appointment],
+/// [sourceResource], [targetResource] and [droppingTime].
+///
+/// See also:
+/// * [SfCalendar.onDragEnd], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
+/// * [AppointmentDragEndCallback], signature when appointment dragging ends
+/// in calendar.
+class AppointmentDragEndDetails {
+ /// Creates details for [AppointmentDragEndCallback].
+ const AppointmentDragEndDetails(this.appointment, this.sourceResource,
+ this.targetResource, this.droppingTime);
+
+ /// The dropping appointment.
+ final Object? appointment;
+
+ /// The source resource of the dropping appointment.
+ final CalendarResource? sourceResource;
+
+ /// The dropping resource of the appointment.
+ final CalendarResource? targetResource;
+
+ /// The dropping time.
+ final DateTime? droppingTime;
+}
+
/// Signature for a function that creates a widget based on month
/// header details.
+///
+/// See also:
+/// * [SfCalendar.scheduleViewMonthHeaderBuilder], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef ScheduleViewMonthHeaderBuilder = Widget Function(
BuildContext context, ScheduleViewMonthHeaderDetails details);
/// Signature for a function that creates a widget based on month cell details.
+///
+/// See also:
+/// * [SfCalendar.monthCellBuilder], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef MonthCellBuilder = Widget Function(
BuildContext context, MonthCellDetails details);
/// Signature for a function that creates a widget based on appointment details.
+///
+/// See also:
+/// * [SfCalendar.appointmentBuilder], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef CalendarAppointmentBuilder = Widget Function(BuildContext context,
CalendarAppointmentDetails calendarAppointmentDetails);
/// Signature for a function that creates a widget based on time region details.
+///
+/// See also:
+/// * [SfCalendar.timeRegionBuilder], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef TimeRegionBuilder = Widget Function(
BuildContext context, TimeRegionDetails timeRegionDetails);
/// Signature for the function that create the widget based on load
/// more details.
+///
+/// See also:
+/// * [SfCalendar.loadMoreWidgetBuilder], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef LoadMoreWidgetBuilder = Widget Function(
BuildContext context, LoadMoreCallback loadMoreAppointments);
/// Signature for the function that have no arguments and return no data, but
/// that return a [Future] to indicate when their work is complete.
+///
+/// See also:
+/// * [SfCalendar.loadMoreWidgetBuilder], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef LoadMoreCallback = Future Function();
/// Signature for a function that creates a widget based on resource
/// header details.
+///
+/// See also:
+/// * [SfCalendar.resourceViewHeaderBuilder], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef ResourceViewHeaderBuilder = Widget Function(
BuildContext context, ResourceViewHeaderDetails details);
/// Contains the details that needed on month cell builder.
+///
+/// Details for the [MonthCellBuilder], such as [date], [appointments],
+/// [visibleDates] and [bounds].
+///
+/// See also:
+/// * [SfCalendar.monthCellBuilder], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
class MonthCellDetails {
/// Default constructor to store the details needed in month cell builder
const MonthCellDetails(
@@ -147,6 +359,11 @@ class MonthCellDetails {
}
/// Contains the details that needed on schedule view month header builder.
+///
+/// See also:
+/// * [SfCalendar.scheduleViewMonthHeaderBuilder], which receives the
+/// information.
+/// * [SfCalendar], which passes the information to one of its receiver.
class ScheduleViewMonthHeaderDetails {
/// Default constructor to store the details needed in builder
const ScheduleViewMonthHeaderDetails(this.date, this.bounds);
@@ -159,6 +376,10 @@ class ScheduleViewMonthHeaderDetails {
}
/// Contains the details that needed on appointment view builder.
+///
+/// See also:
+/// * [SfCalendar.appointmentBuilder], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
class CalendarAppointmentDetails {
/// Default constructor to store the details needed in appointment builder.
const CalendarAppointmentDetails(this.date, this.appointments, this.bounds,
@@ -182,6 +403,10 @@ class CalendarAppointmentDetails {
}
/// Contains the details that needed on special region view builder.
+///
+/// See also:
+/// * [SfCalendar.timeRegionBuilder], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
class TimeRegionDetails {
/// Default constructor to store the details needed in time region builder.
TimeRegionDetails(this.region, this.date, this.bounds);
@@ -198,6 +423,10 @@ class TimeRegionDetails {
}
/// Contains the details that needed on resource view header builder.
+///
+/// See also:
+/// * [SfCalendar.resourceViewHeaderBuilder], which receives the information.
+/// * [SfCalendar], which passes the information to one of its receiver.
class ResourceViewHeaderDetails {
/// Default constructor to store the details needed in resource view
/// header builder.
@@ -218,6 +447,10 @@ class ResourceViewHeaderDetails {
/// in the [ViewChangedDetails].
///
/// Used by [SfCalendar.onViewChanged].
+///
+/// See also:
+/// * [SfCalendar.onViewChanged], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef ViewChangedCallback = void Function(
ViewChangedDetails viewChangedDetails);
@@ -227,6 +460,10 @@ typedef ViewChangedCallback = void Function(
/// performed on element available in the [CalendarTapDetails].
///
/// Used by[SfCalendar.onTap].
+///
+/// See also:
+/// * [SfCalendar.onTap], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef CalendarTapCallback = void Function(
CalendarTapDetails calendarTapDetails);
@@ -237,6 +474,10 @@ typedef CalendarTapCallback = void Function(
/// action performed on element available in the [CalendarLongPressDetails].
///
/// Used by[SfCalendar.onLongPress].
+///
+/// See also:
+/// * [SfCalendar.onLongPress], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef CalendarLongPressCallback = void Function(
CalendarLongPressDetails calendarLongPressDetails);
@@ -248,5 +489,96 @@ typedef CalendarLongPressCallback = void Function(
/// performed on element available in the [CalendarSelectionDetails].
///
/// Used by[SfCalendar.onSelectionChanged].
+///
+/// See also:
+/// * [SfCalendar.onSelectionChanged], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
typedef CalendarSelectionChangedCallback = void Function(
CalendarSelectionDetails calendarSelectionDetails);
+
+/// Signature for callback that reports that a appointment starts resizing in
+/// [SfCalendar].
+///
+/// The resizing appointment and resource details when the appointment starts
+/// to resize available in the [AppointmentResizeStartDetails].
+///
+/// Used by[SfCalendar.onAppointmentResizeStart].
+///
+/// See also:
+/// * [SfCalendar.onAppointmentResizeStart], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
+typedef AppointmentResizeStartCallback = void Function(
+ AppointmentResizeStartDetails appointmentResizeStartDetails);
+
+/// Signature for callback that reports that a appointment resizing in
+/// [SfCalendar].
+///
+/// The resizing appointment, position, time and resource details when the
+/// appointment resizing available in the [AppointmentResizeUpdateDetails].
+///
+/// Used by[SfCalendar.onAppointmentResizeUpdate].
+///
+/// See also:
+/// * [SfCalendar.onAppointmentResizeUpdate], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
+typedef AppointmentResizeUpdateCallback = void Function(
+ AppointmentResizeUpdateDetails appointmentResizeUpdateDetails);
+
+/// Signature for callback that reports that a appointment resizing completed in
+/// [SfCalendar].
+///
+/// The resizing appointment, start time, end time and resource details when
+/// the appointment resizing ends available in the
+/// [AppointmentResizeEndDetails].
+///
+/// Used by[SfCalendar.onAppointmentResizeEnd].
+///
+/// See also:
+/// * [SfCalendar.onAppointmentResizeEnd], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
+typedef AppointmentResizeEndCallback = void Function(
+ AppointmentResizeEndDetails appointmentResizeEndDetails);
+
+/// Signature for callback that reports that a appointment starts dragging in
+/// [SfCalendar].
+///
+/// The dragging appointment and resource details when the appointment starts
+/// to drag available in the [AppointmentDragStartDetails].
+///
+/// Used by[SfCalendar.onDragStart].
+///
+/// See also:
+/// * [SfCalendar.onDragStart], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
+typedef AppointmentDragStartCallback = void Function(
+ AppointmentDragStartDetails appointmentDragStartDetails);
+
+/// Signature for callback that reports that a appointment dragging in
+/// [SfCalendar].
+///
+/// The dragging appointment, position, time, sourceResource and tergetResource
+/// details when the appointment resizing available
+/// in the [AppointmentDragUpdateDetails].
+///
+/// Used by[SfCalendar.onDragUpdate].
+///
+/// See also:
+/// * [SfCalendar.onDragUpdate], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
+typedef AppointmentDragUpdateCallback = void Function(
+ AppointmentDragUpdateDetails appointmentDragUpdateDetails);
+
+/// Signature for callback that reports that a appointment dragging completed in
+/// [SfCalendar].
+///
+/// The dragging appointment, sourceResource, targetResource and droppingTime
+/// when the appointment dragging ends available in the
+/// [AppointmentDragEndDetails].
+///
+/// Used by[SfCalendar.onDragEnd].
+///
+/// See also:
+/// * [SfCalendar.onDragEnd], which matches this signature.
+/// * [SfCalendar], which uses this signature in one of it's callback.
+typedef AppointmentDragEndCallback = void Function(
+ AppointmentDragEndDetails appointmentDragEndDetails);
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/resource_view/calendar_resource.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/resource_view/calendar_resource.dart
index 11b1b0cc7..1033c8fc3 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/resource_view/calendar_resource.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/resource_view/calendar_resource.dart
@@ -1,5 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
+import 'package:syncfusion_flutter_calendar/calendar.dart';
/// The resource data for calendar.
///
@@ -19,6 +20,19 @@ import 'package:flutter/material.dart';
/// The [id] property must not be null, to filter appointments based on
/// resource.
///
+/// See also:
+/// * [Appointment], the object to hold the data for the appointment in the
+/// calendar.
+/// * [TimeRegion], the object to hold the data for the special time region in
+/// the calendar.
+/// * [SfCalendar.resourceViewHeaderBuilder], to set custom widget for the
+/// resource view in the calendar.
+/// * [resourceViewSettings], to customize the resource view in the calendar.
+/// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
+/// * Knowledge base: [How to handle appointments for multiple resources](https://www.syncfusion.com/kb/11812/how-to-handle-appointments-for-multiple-resources-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
+/// * Knowledge base: [How to add appointment for the selected resources using appointment editor](https://www.syncfusion.com/kb/12109/how-to-add-appointment-for-the-selected-resources-using-appointment-editor-in-the-flutter)
+///
/// ``` dart
///
///@override
@@ -82,9 +96,9 @@ class CalendarResource with Diagnosticable {
/// [ResourceViewSettings.displayNameTextStyle] property.
///
/// See also:
- ///
- /// * [ResourceViewSettings], the settings have properties which allow to
- /// customize the resource view of the [SfCalendar].
+ /// * [ResourceViewSettings.displayNameTextStyle], which allows to customize
+ /// the display name text in the resource view in [SfCalendar].
+ /// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
///
/// ``` dart
///
@@ -115,7 +129,6 @@ class CalendarResource with Diagnosticable {
/// The unique id for the [CalendarResource] view of [SfCalendar].
///
/// See also:
- ///
/// * [Appointment.resourceIds], the ids of the [CalendarResource] that shares
/// an [Appointment].
/// * [TimeRegion.resourceIds], the ids of the [CalendarResource] that shares
@@ -154,6 +167,11 @@ class CalendarResource with Diagnosticable {
///
/// Defaults to `Colors.lightBlue`.
///
+ /// See also:
+ /// * [ResourceViewSettings], to customize the resource view in the calendar.
+ /// * [SfCalendar.resourceViewHeaderBuilder], to customize the resource view
+ /// with a custom widget in calendar.
+ ///
/// ``` dart
///
///DataSource _getCalendarDataSource() {
@@ -186,12 +204,15 @@ class CalendarResource with Diagnosticable {
/// `true`.
///
/// See also:
- ///
- /// * [ResourceViewSettings], the settings have properties which allow to
- /// customize the resource view of the [SfCalendar].
- /// * [ResourceViewSettings.showAvatar], shows a circle that represents a
- /// user.
- /// * [ImageProvider], commonly used to add image in flutter
+ /// * [ResourceViewSettings], which allows to customize the resource view in
+ /// the calendar.
+ /// * [ResourceViewSettings.showAvatar], allows to display the [image] on the
+ /// resource view.
+ /// * [ImageProvider], commonly used to add image in flutter.
+ /// * [SfCalendar.resourceViewHeaderBuilder], to customize the resource view
+ /// with a custom widget in calendar.
+ /// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
///
/// ``` dart
///
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/drag_and_drop_settings.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/drag_and_drop_settings.dart
new file mode 100644
index 000000000..6ce0c634e
--- /dev/null
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/drag_and_drop_settings.dart
@@ -0,0 +1,257 @@
+import 'package:flutter/foundation.dart';
+import 'package:flutter/material.dart';
+
+/// The settings have properties which allow to customize the drag and drop
+/// environment of the [SfCalendar].
+///
+/// Allows to customize the [allowNavigation], [allowScroll],
+/// [autoNavigateDelay], [indicatorTimeFormat], [showTimeIndicator]
+/// and [timeIndicatorStyle] in the [SfCalendar].
+///
+/// See also:
+/// * [monthViewSettings], which allows to customize the month view of
+/// the calendar.
+/// * [timeSlotViewSettings], which allows to customize the timeslot view
+/// of the calendar.
+///
+/// ``` dart
+/// Widget build(BuildContext context) {
+/// return Scaffold(
+/// body: SfCalendar(
+/// view: CalendarView.month,
+/// showWeekNumber: true,
+/// allowDragAndDrop: true,
+/// dragAndDropSettings: DragAndDropSettings(
+/// allowNavigation: true,
+/// allowScroll: true,
+/// autoNavigateDelay: Duration(seconds: 1),
+/// indicatorTimeFormat: 'HH:mm a',
+/// showTimeIndicator: true,
+/// timeIndicatorStyle: TextStyle(color: Colors.cyan),
+/// ),
+/// ),
+/// );
+/// }
+@immutable
+class DragAndDropSettings with Diagnosticable {
+ /// Creates a Drag and Drop settings for calendar.
+ ///
+ /// The properties allows to customize the Drag and Drop of [SfCalendar].
+ const DragAndDropSettings({
+ this.allowNavigation = true,
+ this.allowScroll = true,
+ this.showTimeIndicator = true,
+ this.timeIndicatorStyle,
+ this.indicatorTimeFormat = 'HH:mm a',
+ this.autoNavigateDelay = const Duration(seconds: 1),
+ });
+
+ /// Allows view navigation when the dragging appointment reaches the start or
+ /// end position of the view.
+ ///
+ /// See also:
+ /// * [allowScroll], which allows to auto scroll the timeslot views when it
+ /// reaches the start or end position of view port.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// ),
+ /// );
+ /// }
+ final bool allowNavigation;
+
+ /// Allows to scroll the view when the dragging appointment reaches the
+ /// view port start or end position in timeslot views.
+ ///
+ /// See also:
+ /// * [allowNavigation], which allows to navigate to next or previous view
+ /// when the dragging appointment reaches the start or end position
+ /// of the view.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// ),
+ /// );
+ /// }
+ final bool allowScroll;
+
+ /// Displays the time indicator on the time ruler view.
+ ///
+ /// The indicator will display the dragging appointment time on the time ruler
+ /// view of calendar.
+ ///
+ /// See also:
+ /// * [timeIndicatorStyle], which used to customize the time indicator text.
+ /// * [indicatorTimeFormat], which used to format the time indicator text
+ /// in calendar.
+ ///
+ /// Note:
+ /// When the [timeSlotViewSettings.timeRulerSize], when this property
+ /// set as 0, the time indicator will not displayed even
+ /// the [showTimeIndicator] set as true.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// ),
+ /// );
+ /// }
+ final bool showTimeIndicator;
+
+ /// Allows to set style for the time indicator text.
+ ///
+ /// See also:
+ /// * [showTimeIndicator], which allows to display the time indicator.
+ /// * [indicatorTimeFormat], which used to format the time indicator text
+ /// in calendar.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// timeIndicatorStyle: TextStyle(color: Colors.cyan),
+ /// ),
+ /// ),
+ /// );
+ /// }
+ final TextStyle? timeIndicatorStyle;
+
+ /// Allows to format the time indicator text.
+ ///
+ /// See also:
+ /// * [showTimeIndicator], which allows to display the time indicator.
+ /// * [timeIndicatorStyle], which used to customize the time indicator text.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// ),
+ /// );
+ /// }
+ final String indicatorTimeFormat;
+
+ ///The delay to hold the appointment on the view start or end position,
+ /// to navigate to next or previous view.
+ ///
+ /// See also:
+ /// * [allowViewNavigation], which allows to navigate to next or
+ /// previous date when the dragging appointment reaches the start or
+ /// end position of the view.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// ),
+ /// );
+ /// }
+ final Duration autoNavigateDelay;
+
+ @override
+ bool operator ==(dynamic other) {
+ if (identical(this, other)) {
+ return true;
+ }
+ if (other.runtimeType != runtimeType) {
+ return false;
+ }
+
+ late final DragAndDropSettings otherSetting;
+ if (other is DragAndDropSettings) {
+ otherSetting = other;
+ }
+ return otherSetting.allowNavigation == allowNavigation &&
+ otherSetting.allowScroll == allowScroll &&
+ otherSetting.showTimeIndicator == showTimeIndicator &&
+ otherSetting.timeIndicatorStyle == timeIndicatorStyle &&
+ otherSetting.indicatorTimeFormat == indicatorTimeFormat &&
+ otherSetting.autoNavigateDelay == autoNavigateDelay;
+ }
+
+ @override
+ void debugFillProperties(DiagnosticPropertiesBuilder properties) {
+ super.debugFillProperties(properties);
+ properties
+ .add(DiagnosticsProperty('allowNavigation', allowNavigation));
+ properties.add(DiagnosticsProperty('allowScroll', allowScroll));
+ properties
+ .add(DiagnosticsProperty('showTimeIndicator', showTimeIndicator));
+ properties.add(DiagnosticsProperty(
+ 'timeIndicatorStyle', timeIndicatorStyle));
+ properties.add(DiagnosticsProperty(
+ 'indicatorTimeFormat', indicatorTimeFormat));
+ properties.add(
+ DiagnosticsProperty('autoNavigateDelay', autoNavigateDelay));
+ }
+
+ @override
+ int get hashCode {
+ return hashValues(allowNavigation, allowScroll, showTimeIndicator,
+ timeIndicatorStyle, indicatorTimeFormat, autoNavigateDelay);
+ }
+}
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/header_style.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/header_style.dart
index 27d391096..864e28fcc 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/header_style.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/header_style.dart
@@ -8,6 +8,15 @@ import 'package:flutter/material.dart';
///
/// 
///
+/// See also:
+/// * [SfCalendar.headerHeight], which allows to customize seize of the header
+/// view in calendar.
+/// * [SfCalendar.headerDateFormat], to format the date string in the header
+/// view of calendar.
+/// * Knowledge base: [How to style a header](https://www.syncfusion.com/kb/12144/how-to-style-a-header-in-the-flutter-calendar)
+/// * Knowledge base: [How to add custom header and view header](https://www.syncfusion.com/kb/10997/how-to-add-custom-header-and-view-header-in-the-flutter-calendar)
+///
+///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -36,6 +45,11 @@ class CalendarHeaderStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [SfCalendar.headerDateFormat], to format the date string in the header
+ /// view of calendar.
+ /// * Knowledge base: [How to style a header](https://www.syncfusion.com/kb/12144/how-to-style-a-header-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -55,6 +69,9 @@ class CalendarHeaderStyle with Diagnosticable {
///
/// Defaults to `TextAlign.start`.
///
+ /// See also:
+ /// * Knowledge base: [How to style a header](https://www.syncfusion.com/kb/12144/how-to-style-a-header-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -77,6 +94,11 @@ class CalendarHeaderStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [SfCalendar.headerHeight], which allows to customize seize of the header
+ /// view in calendar.
+ /// * Knowledge base: [How to style a header](https://www.syncfusion.com/kb/12144/how-to-style-a-header-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/month_view_settings.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/month_view_settings.dart
index 6f5fa6a9a..2c88ce0ba 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/month_view_settings.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/month_view_settings.dart
@@ -1,5 +1,6 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
+import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../common/enums.dart';
/// The settings have properties which allow to customize the month view of
@@ -10,6 +11,29 @@ import '../common/enums.dart';
/// [showTrailingAndLeadingDates] and [navigationDirection] in month view of
/// [SfCalendar].
///
+/// See also:
+/// * [TimeSlotViewSettings], which is used to customize the timeslot view of
+/// calendar.
+/// * [SfCalendar.monthCellBuilder], which used to set the custom widget for
+/// month cell in calendar.
+/// * [SfCalendar.monthViewSettings], to know more about the customization of
+/// month view in calendar.
+/// * [SfCalendar.blackoutDates], which allows to restrict the interaction for a
+/// particular date in month views of calendar.
+/// * [SfCalendar.blackoutDatesTextStyle], which used to customize the blackout
+/// dates text style in the month view of calendar.
+/// * Knowledge base: [How to customize agenda view height based on widget height](https://www.syncfusion.com/kb/11013/how-to-customize-agenda-view-height-based-on-the-flutter-calendar-widget-height)
+/// * Knowledge base: [How to customize agenda item height](https://www.syncfusion.com/kb/11015/how-to-customize-the-agenda-item-height-in-the-flutter-calendar)
+/// * Knowledge base: [How to show appointment in agenda view using programmatic date selection](https://www.syncfusion.com/kb/11525/how-to-show-the-appointment-in-agenda-view-using-the-programmatic-date-selection-in-the)
+/// * Knowledge base: [How to customize the blackout dates](https://www.syncfusion.com/kb/11987/how-to-customize-the-blackout-dates-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+/// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+/// * Knowledge base: [How to change the number of weeks](https://www.syncfusion.com/kb/12157/how-to-change-the-number-of-weeks-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+/// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+/// * Knowledge base: [How to clear the appointment in month agenda view using onViewChanged callback](https://www.syncfusion.com/kb/12089/how-to-clear-the-appointments-in-month-agenda-view-using-onviewchange-callback-in-the)
+///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -54,6 +78,11 @@ class MonthViewSettings with Diagnosticable {
///
/// Defaults to `EE`.
///
+ /// See also:
+ /// * [ViewHeaderStyle], which is used to customize the view header view of
+ /// the calendar.
+ /// * Knowledge base: [How to format the view header day and date format](https://www.syncfusion.com/kb/12339/how-to-format-the-view-header-day-and-date-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -116,6 +145,21 @@ class MonthViewSettings with Diagnosticable {
///
/// 
///
+ /// See more:
+ /// * [showAgenda], which allows to display agenda view as a part of
+ /// month view in calendar.
+ /// * [agendaViewHeight], which is the size for agenda view on month view of
+ /// calendar.
+ /// * [agendaStyle], which is used to customize the agenda view on month view
+ /// of calendar.
+ /// * [appointmentDisplayMode], which allows to customize the display mode
+ /// of appointment view in month cells of calendar.
+ /// * Knowledge base: [How to customize agenda view height based on widget height](https://www.syncfusion.com/kb/11013/how-to-customize-agenda-view-height-based-on-the-flutter-calendar-widget-height)
+ /// * Knowledge base: [How to customize agenda item height](https://www.syncfusion.com/kb/11015/how-to-customize-the-agenda-item-height-in-the-flutter-calendar)
+ /// * Knowledge base: [How to show appointment in agenda view using programmatic date selection](https://www.syncfusion.com/kb/11525/how-to-show-the-appointment-in-agenda-view-using-the-programmatic-date-selection-in-the)
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ /// * Knowledge base: [How to clear the appointment in month agenda view using onViewChanged callback](https://www.syncfusion.com/kb/12089/how-to-clear-the-appointments-in-month-agenda-view-using-onviewchange-callback-in-the)
+ ///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -164,6 +208,21 @@ class MonthViewSettings with Diagnosticable {
/// [MonthCellStyle.leadingDatesTextStyle] and
/// [MonthCellStyle.trailingDatesTextStyle] properties in [MonthCellStyle].
///
+ /// See also:
+ /// * [numberOfWeeksInView], which allows to customize the displaying week
+ /// count in month view of calendar.
+ /// * [monthCellStyle.leadingDatesBackgroundColor], which fills the background
+ /// of the leading dates cell in month view of calendar.
+ /// * [monthCellStyle.leadingDatesTextStyle], which is the style for the
+ /// leading dates text in month view of calendar.
+ /// * [monthCellStyle.trailingDatesBackgroundColor], which fills the
+ /// background of the trailing dates cell in month view of calendar.
+ /// * [monthCellStyle.trailingDatesTextStyle], which is the style for the
+ /// trailing dates text in month view of calendar.
+ /// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to change the number of weeks](https://www.syncfusion.com/kb/12157/how-to-change-the-number-of-weeks-in-the-flutter-calendar)
+ ///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -190,6 +249,25 @@ class MonthViewSettings with Diagnosticable {
///
/// Defaults to null.
///
+ /// See more:
+ /// * [agendaStyle], which used to customize the agenda view on month view
+ /// of calendar.
+ /// * [appointmentDisplayMode], which is used to customize the appointment
+ /// display mode in month cells of calendar.
+ /// * [SfCalendar.monthCellBuilder], which used to set the custom widget for
+ /// month cell in calendar.
+ /// * [SfCalendar.blackoutDates], which allows to restrict the interaction for
+ /// a particular date in month views of calendar.
+ /// * [SfCalendar.blackoutDatesTextStyle], which used to customize the
+ /// blackout dates text style in the month view of calendar.
+ /// * [SfCalendarTheme], to handle theming with calendar for giving consistent
+ /// look.
+ /// * Knowledge base: [How to customize the blackout dates](https://www.syncfusion.com/kb/11987/how-to-customize-the-blackout-dates-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -251,6 +329,22 @@ class MonthViewSettings with Diagnosticable {
/// [AgendaStyle.dayTextStyle], [AgendaStyle.dateTextStyle] and
/// [AgendaStyle.appointmentTextStyle] in month agenda view of calendar.
///
+ /// See also:
+ /// * [monthCellStyle], which used to customize the month cell of month view
+ /// in calendar.
+ /// * [showAgenda], which allows to display agenda view as a part of
+ /// month view in calendar.
+ /// * [agendaViewHeight], which is the size for agenda view on month view of
+ /// calendar.
+ /// * [appointmentDisplayMode], which is used to customize the appointment
+ /// display mode in month cells of calendar.
+ /// * Knowledge base: [How to customize agenda view height based on widget height](https://www.syncfusion.com/kb/11013/how-to-customize-agenda-view-height-based-on-the-flutter-calendar-widget-height)
+ /// * Knowledge base: [How to customize agenda item height](https://www.syncfusion.com/kb/11015/how-to-customize-the-agenda-item-height-in-the-flutter-calendar)
+ /// * Knowledge base: [How to show appointment in agenda view using programmatic date selection](https://www.syncfusion.com/kb/11525/how-to-show-the-appointment-in-agenda-view-using-the-programmatic-date-selection-in-the)
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ /// * Knowledge base: [How to clear the appointment in month agenda view using onViewChanged callback](https://www.syncfusion.com/kb/12089/how-to-clear-the-appointments-in-month-agenda-view-using-onviewchange-callback-in-the)
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ ///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -282,7 +376,6 @@ class MonthViewSettings with Diagnosticable {
/// );
/// }
/// ```
-
final AgendaStyle agendaStyle;
/// The number of weeks to display in [ SfCalendar ]'s month view.
@@ -292,7 +385,14 @@ class MonthViewSettings with Diagnosticable {
/// _Note:_ If this property is set to a value less than or equal to ' 4, '
/// the trailing and lead dates style will not be updated.
///
- /// See also: [MonthCellStyle] to know about leading and trailing dates style.
+ /// See also:
+ /// * [showTrailingAndLeadingDates], which used to restrict the rendering of
+ /// leading and trailing dates on month view of calendar.
+ /// * [showAgenda], which allows to display agenda view as a part of
+ /// month view in calendar.
+ /// * [agendaViewHeight], which is the size for agenda view on month view of
+ /// calendar.
+ /// * Knowledge base: [How to change the number of weeks](https://www.syncfusion.com/kb/12157/how-to-change-the-number-of-weeks-in-the-flutter-calendar)
///
/// ```dart
///Widget build(BuildContext context) {
@@ -326,6 +426,15 @@ class MonthViewSettings with Diagnosticable {
/// less (available for only 4 dots) and the indicator count is 10, then 4
/// indicators will be shown
///
+ /// See also:
+ /// * [appointmentDisplayMode], which allows to customize the display mode
+ /// of appointment view in month cells of calendar.
+ /// * [showAgenda], which allows to display agenda view as a part of
+ /// month view in calendar.
+ /// * [agendaViewHeight], which is the size for agenda view on month view of
+ /// calendar.
+ /// * [agendaItemHeight], which is the size for every single appointment view
+ /// in agenda view of month view in calendar.
///
/// ```dart
///Widget build(BuildContext context) {
@@ -349,7 +458,19 @@ class MonthViewSettings with Diagnosticable {
///
/// Defaults to `MonthAppointmentDisplayMode.indicator`.
///
- /// Also refer: [MonthAppointmentDisplayMode].
+ /// See also:
+ /// * [MonthAppointmentDisplayMode], to know more about the available display
+ /// options for appointment view in month cell of calendar.
+ /// * [appointmentDisplayCount], which allows to customize the number of
+ /// appointment displaying on a month cell of month view in calendar.
+ /// * [showAgenda], which allows to display agenda view as a part of
+ /// month view in calendar.
+ /// * [agendaViewHeight], which is the size for agenda view on month view of
+ /// calendar.
+ /// * [agendaItemHeight], which is the size for every single appointment view
+ /// in agenda view of month view in calendar.
+ /// * Knowledge base: [How to handle the appointment display mode](https://www.syncfusion.com/kb/12338/how-to-handle-the-appointment-display-mode-in-the-flutter-calendar)
+ ///
///
/// ```dart
///Widget build(BuildContext context) {
@@ -385,8 +506,20 @@ class MonthViewSettings with Diagnosticable {
/// 
///
/// see also:
- /// [agendaHeight].
- /// [agendaItemHeight]
+ /// * [agendaViewHeight], which is the size for agenda view on month view of
+ /// calendar.
+ /// * [agendaItemHeight], which is the size for every appointment in the
+ /// agenda view of month view in calendar.
+ /// * [agendaStyle], which is used to customize the agenda view on month view
+ /// of calendar.
+ /// * [appointmentDisplayMode], which allows to customize the display mode
+ /// of appointment view in month cells of calendar.
+ /// * Knowledge base: [How to customize agenda view height based on widget height](https://www.syncfusion.com/kb/11013/how-to-customize-agenda-view-height-based-on-the-flutter-calendar-widget-height)
+ /// * Knowledge base: [How to customize agenda item height](https://www.syncfusion.com/kb/11015/how-to-customize-the-agenda-item-height-in-the-flutter-calendar)
+ /// * Knowledge base: [How to show appointment in agenda view using programmatic date selection](https://www.syncfusion.com/kb/11525/how-to-show-the-appointment-in-agenda-view-using-the-programmatic-date-selection-in-the)
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ /// * Knowledge base: [How to clear the appointment in month agenda view using onViewChanged callback](https://www.syncfusion.com/kb/12089/how-to-clear-the-appointments-in-month-agenda-view-using-onviewchange-callback-in-the)
+ /// * Knowledge base: [How to show a custom agenda view](https://www.syncfusion.com/kb/11016/how-to-show-a-custom-agenda-view-in-the-flutter-calendar)
///
/// ```dart
///Widget build(BuildContext context) {
@@ -413,6 +546,22 @@ class MonthViewSettings with Diagnosticable {
///
/// 
///
+ /// See also:
+ /// * [showAgenda], which allows to display agenda view as a part of
+ /// month view in calendar.
+ /// * [agendaItemHeight], which is the size for every appointment in the
+ /// agenda view of month view in calendar.
+ /// * [agendaStyle], which is used to customize the agenda view on month view
+ /// of calendar.
+ /// * [appointmentDisplayMode], which allows to customize the display mode
+ /// of appointment view in month cells of calendar.
+ /// * Knowledge base: [How to customize agenda view height based on widget height](https://www.syncfusion.com/kb/11013/how-to-customize-agenda-view-height-based-on-the-flutter-calendar-widget-height)
+ /// * Knowledge base: [How to customize agenda item height](https://www.syncfusion.com/kb/11015/how-to-customize-the-agenda-item-height-in-the-flutter-calendar)
+ /// * Knowledge base: [How to show appointment in agenda view using programmatic date selection](https://www.syncfusion.com/kb/11525/how-to-show-the-appointment-in-agenda-view-using-the-programmatic-date-selection-in-the)
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ /// * Knowledge base: [How to clear the appointment in month agenda view using onViewChanged callback](https://www.syncfusion.com/kb/12089/how-to-clear-the-appointments-in-month-agenda-view-using-onviewchange-callback-in-the)
+ /// * Knowledge base: [How to show a custom agenda view](https://www.syncfusion.com/kb/11016/how-to-show-a-custom-agenda-view-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -440,7 +589,15 @@ class MonthViewSettings with Diagnosticable {
///
/// Defaults to `MonthNavigationDirection.horizontal`.
///
- /// Also refer: [MonthNavigationDirection].
+ /// See also:
+ /// * [MonthNavigationDirection], to know more about the available navigation
+ /// direction in month view of calendar.
+ /// * [SfCalendar.viewNavigationMode], which allows to customize the view
+ /// navigation mode for calendar.
+ /// * [SfCalendar.showNavigationArrow], which allows to navigation to previous
+ /// and next view of calendar programmatically.
+ /// * Knowledge base: [How to restrict the view navigation](https://www.syncfusion.com/kb/12554/how-to-restrict-the-view-navigation-in-the-flutter-calendar)
+ /// * Knowledge base: [How to navigate to the previous or next view using navigation arrows](https://www.syncfusion.com/kb/12247/how-to-navigate-to-the-previous-or-next-views-using-navigation-arrows-in-the-flutter)
///
/// ```dart
///Widget build(BuildContext context) {
@@ -530,6 +687,22 @@ class MonthViewSettings with Diagnosticable {
/// Allows to customize the [backgroundColor], [dayTextStyle], [dateTextStyle]
/// and [appointmentTextStyle] in month agenda view of calendar.
///
+/// See also:
+/// * [MonthCellStyle], which used to customize the month cell of month view
+/// in calendar.
+/// * [MonthViewSettings.showAgenda], which allows to display agenda view as a
+/// part of month view in calendar.
+/// * [MonthViewSettings.agendaViewHeight], which is the size for agenda view on
+/// month view of calendar.
+/// * [MonthViewSettings.appointmentDisplayMode], which is used to customize the
+/// appointment display mode in month cells of calendar.
+/// * Knowledge base: [How to customize agenda view height based on widget height](https://www.syncfusion.com/kb/11013/how-to-customize-agenda-view-height-based-on-the-flutter-calendar-widget-height)
+/// * Knowledge base: [How to customize agenda item height](https://www.syncfusion.com/kb/11015/how-to-customize-the-agenda-item-height-in-the-flutter-calendar)
+/// * Knowledge base: [How to show appointment in agenda view using programmatic date selection](https://www.syncfusion.com/kb/11525/how-to-show-the-appointment-in-agenda-view-using-the-programmatic-date-selection-in-the)
+/// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+/// * Knowledge base: [How to clear the appointment in month agenda view using onViewChanged callback](https://www.syncfusion.com/kb/12089/how-to-clear-the-appointments-in-month-agenda-view-using-onviewchange-callback-in-the)
+/// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -581,6 +754,18 @@ class AgendaStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [SfCalendar.appointmentBuilder], which used to set custom widget for
+ /// appointment view in calendar
+ /// * [dayTextStyle], which used to customize the day text in the agenda
+ /// view of calendar.
+ /// * [dateTextStyle], which used to customize the date text in the agenda
+ /// view of calendar.
+ /// * [backgroundColor], which fills the background of the agenda view in
+ /// calendar.
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ ///
+ ///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -622,6 +807,16 @@ class AgendaStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [appointmentTextStyle], which used to customize the text on the
+ /// agenda view of calendar.
+ /// * [dateTextStyle], which used to customize the date text in the
+ /// agenda view of calendar.
+ /// * [backgroundColor], which fills the background of the agenda view in
+ /// calendar.
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ /// * Knowledge base: [How to show a custom agenda view](https://www.syncfusion.com/kb/11016/how-to-show-a-custom-agenda-view-in-the-flutter-calendar)
+ ///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -663,6 +858,16 @@ class AgendaStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [appointmentTextStyle], which used to customize the text on the
+ /// agenda view of calendar.
+ /// * [dayTextStyle], which used to customize the day text in the
+ /// agenda view of calendar.
+ /// * [backgroundColor], which fills the background of the agenda view in
+ /// calendar.
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ /// * Knowledge base: [How to show a custom agenda view](https://www.syncfusion.com/kb/11016/how-to-show-a-custom-agenda-view-in-the-flutter-calendar)
+ ///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -704,6 +909,16 @@ class AgendaStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [appointmentTextStyle], which used to customize the text on the
+ /// agenda view of calendar.
+ /// * [dateTextStyle], which used to customize the date text in the
+ /// agenda view of calendar.
+ /// * [dayTextStyle], which used to customize the day text in the
+ /// agenda view of calendar.
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ /// * Knowledge base: [How to show a custom agenda view](https://www.syncfusion.com/kb/11016/how-to-show-a-custom-agenda-view-in-the-flutter-calendar)
+ ///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -786,6 +1001,25 @@ class AgendaStyle with Diagnosticable {
/// [leadingDatesBackgroundColor] and [trailingDatesBackgroundColor] in month
/// cells of month view in calendar.
///
+/// See more:
+/// * [AgendaStyle], which used to customize the agenda view on month view
+/// of calendar.
+/// * [MonthViewSettings.appointmentDisplayMode], which is used to customize the
+/// appointment display mode in month cells of calendar.
+/// * [SfCalendar.monthCellBuilder], which used to set the custom widget for
+/// month cell in calendar.
+/// * [SfCalendar.blackoutDates], which allows to restrict the interaction for
+/// a particular date in month views of calendar.
+/// * [SfCalendar.blackoutDatesTextStyle], which used to customize the
+/// blackout dates text style in the month view of calendar.
+/// * [SfCalendarTheme], to handle theming with calendar for giving consistent
+/// look.
+/// * Knowledge base: [How to customize the blackout dates](https://www.syncfusion.com/kb/11987/how-to-customize-the-blackout-dates-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+/// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -866,6 +1100,19 @@ class MonthCellStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [backgroundColor], which fills the background of the month cell in
+ /// calendar.
+ /// * [leadingDatesTextStyle], which used to customize the text style for
+ /// the leading dates text in month cell of month view.
+ /// * [trailingDatesTextStyle], which used to customize the text style for
+ /// the trailing dates text in month cell of month view.
+ /// * [SfCalendar.todayTextStyle], which used to customize the text style
+ /// for the today text cell in the month view of calendar.
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -949,6 +1196,20 @@ class MonthCellStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [textStyle], which used to customize the text style for the text in
+ /// month cell of calendar.
+ /// * [leadingDatesTextStyle], which used to customize the text style for
+ /// the leading dates text in month cell of month view.
+ /// * [SfCalendar.todayTextStyle], which used to customize the text style
+ /// for the today text cell in the month view of calendar.
+ /// * [trailingDatesBackgroundColor], which fills the background of the
+ /// trailing dates cells of month view in calendar.
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+ /// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -990,6 +1251,20 @@ class MonthCellStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [textStyle], which used to customize the text style for the text in
+ /// month cell of calendar.
+ /// * [trailingDatesTextStyle], which used to customize the text style for
+ /// the trailing dates text in month cell of month view.
+ /// * [SfCalendar.todayTextStyle], which used to customize the text style
+ /// for the today text cell in the month view of calendar.
+ /// * [leadingDatesBackgroundColor], which fills the background of the
+ /// leading dates cells of month view in calendar.
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+ /// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -1031,6 +1306,20 @@ class MonthCellStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [todayBackgroundColor], which used to fill the background of the today
+ /// date month cell in the calendar.
+ /// * [trailingDatesBackgroundColor], which fills the background of the
+ /// trailing dates cells of month view in calendar.
+ /// * [leadingDatesBackgroundColor], which fills the background of the
+ /// leading dates cells of month view in calendar.
+ /// * [textStyle], which used to customize the text style of texts in month
+ /// cell in month view of calendar.
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+ /// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -1072,6 +1361,20 @@ class MonthCellStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [backgroundColor], which used to fill the background of the month cells
+ /// in the calendar.
+ /// * [trailingDatesBackgroundColor], which fills the background of the
+ /// trailing dates cells of month view in calendar.
+ /// * [leadingDatesBackgroundColor], which fills the background of the
+ /// leading dates cells of month view in calendar.
+ /// * [SfCalendar.todayTextStyle], which used to customize the text style of
+ /// texts in today date month cell of calendar.
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+ /// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -1113,6 +1416,20 @@ class MonthCellStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [backgroundColor], which used to fill the background of the month cells
+ /// in the calendar.
+ /// * [todayBackgroundColor], which fills the background of the today date
+ /// cell of month view in calendar.
+ /// * [leadingDatesBackgroundColor], which fills the background of the
+ /// leading dates cells of month view in calendar.
+ /// * [trailingDatesTextStyle], which used to customize the text style of
+ /// text in the trailing dates month cell of calendar.
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+ /// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -1154,6 +1471,20 @@ class MonthCellStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [backgroundColor], which used to fill the background of the month cells
+ /// in the calendar.
+ /// * [todayBackgroundColor], which fills the background of the today date
+ /// cell of month view in calendar.
+ /// * [trailingDatesBackgroundColor], which fills the background of the
+ /// trailing dates cells of month view in calendar.
+ /// * [leadingDatesTextStyle], which used to customize the text style of
+ /// text in the leading dates month cell of calendar.
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the month cell based on the appointment using builder](https://www.syncfusion.com/kb/12210/how-to-customize-the-month-cell-based-on-the-appointment-using-builder-in-the-flutter)
+ /// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/resource_view_settings.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/resource_view_settings.dart
index b35486033..b75e601bb 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/resource_view_settings.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/resource_view_settings.dart
@@ -8,10 +8,14 @@ import 'package:flutter/material.dart';
/// [size], and [displayNameTextStyle] in resource view of calendar.
///
/// See also:
+/// * [CalendarResource], which holds the data for the resource in the
+/// * [CalendarDataSource.resources], which used to set and handle the resource
+/// collection for the calendar.
+/// * [SfCalendar.resourceViewHeaderBuilder], which used to set custom widget
+/// for the resource view header in calendar.
+/// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
+/// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
///
-/// * [CalendarResource], the resource data for calendar.
-/// * [CalendarDataSource.resources], the collection of resource to be displayed
-/// in the timeline views of [SfCalendar].
///
/// ```dart
///@override
@@ -76,10 +80,12 @@ class ResourceViewSettings with Diagnosticable {
/// [SfCalendar]
///
/// See also:
- ///
- /// * [CalendarResource], the resource data for calendar.
- /// * [CalendarDataSource.resources], the collection of resource to be
- /// displayed in the timeline views of [SfCalendar].
+ /// * [CalendarResource], the object which holds the data for the resource in
+ /// the calendar
+ /// * [CalendarDataSource.resources], which set and handle the resource
+ /// collection for the calendar.
+ /// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
///
/// ```dart
///@override
@@ -108,10 +114,14 @@ class ResourceViewSettings with Diagnosticable {
/// appearance of various components of the calendar.
///
/// See also:
- ///
- /// * [CalendarResource], the resource data for calendar.
- /// * [CalendarDataSource.resources], the collection of resource to be
- /// displayed in the timeline views of [SfCalendar].
+ /// * [CalendarResource], the object which holds the data for the resource in
+ /// the calendar
+ /// * [CalendarDataSource.resources], which set and handle the resource
+ /// collection for the calendar.
+ /// * [SfCalendar.resourceViewHeaderBuilder], which allows to set custom
+ /// widget for the resource view header.in calendar.
+ /// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
///
/// ```dart
///@override
@@ -140,10 +150,14 @@ class ResourceViewSettings with Diagnosticable {
/// Defaults to `75`.
///
/// See also:
- ///
- /// * [CalendarResource], the resource data for calendar.
- /// * [CalendarDataSource.resources], the collection of resource to be
- /// displayed in the timeline views of [SfCalendar].
+ /// * [CalendarResource], the object which holds the data for the resource in
+ /// the calendar
+ /// * [CalendarDataSource.resources], which set and handle the resource
+ /// collection for the calendar.
+ /// * [SfCalendar.resourceViewHeaderBuilder], which allows to set custom
+ /// widget for the resource view header.in calendar.
+ /// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
///
/// ```dart
///@override
@@ -175,10 +189,14 @@ class ResourceViewSettings with Diagnosticable {
///
///
/// See also:
- ///
- /// * [CalendarResource], the resource data for calendar.
- /// * [CalendarDataSource.resources], the collection of resource to be
- /// displayed in the timeline views of [SfCalendar].
+ /// * [CalendarResource], the object which holds the data for the resource in
+ /// the calendar
+ /// * [CalendarDataSource.resources], which set and handle the resource
+ /// collection for the calendar.
+ /// * [SfCalendar.resourceViewHeaderBuilder], which allows to set custom
+ /// widget for the resource view header.in calendar.
+ /// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
///
/// ```dart
///@override
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/schedule_view_settings.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/schedule_view_settings.dart
index 25f0834a2..8567b733c 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/schedule_view_settings.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/schedule_view_settings.dart
@@ -8,6 +8,21 @@ import 'package:flutter/material.dart';
/// [dayHeaderSettings], [appointmentTextStyle], [appointmentItemHeight] and
/// [hideEmptyScheduleWeek] in schedule view of calendar.
///
+/// See also:
+/// * [SfCalendar.scheduleViewMonthHeaderBuilder], which used to set custom
+/// widget for month header view of schedule view in calendar.
+/// * [SfCalendar.scheduleViewSettings], to know about the available
+/// customization options for schedule view.
+/// * [MonthViewSettings], to know more about the customization options for
+/// the month view of calendar.
+/// * [TimeSlotViewSettings], which is used to customize the timeslot view of
+/// calendar.
+/// * Knowledge base: [How to customize appointment height in schedule view](https://www.syncfusion.com/kb/12226/how-to-customize-the-appointment-height-in-schedule-view-of-the-flutter-calendar)
+/// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+/// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+///
/// ``` dart
///
/// @override
@@ -48,6 +63,18 @@ class ScheduleViewSettings with Diagnosticable {
/// [MonthHeaderSettings.labelTextStyle] in month label style of schedule view
/// in calendar.
///
+ /// See also:
+ /// * [weekHeaderSettings], which used to customize the week header view
+ /// of the schedule view in calendar.
+ /// * [dayHeaderSettings], which used to customize the day header view of the
+ /// schedule view in calendar.
+ /// * [SfCalendar.scheduleViewMonthHeaderBuilder], which used to set custom
+ /// widget for month header view of schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
///@override
@@ -80,6 +107,17 @@ class ScheduleViewSettings with Diagnosticable {
/// [WeekHeaderSettings.labelTextStyle] in week label style of schedule view
/// in calendar.
///
+ /// See also:
+ /// * [monthHeaderSettings], which used to customize the month header view
+ /// of the schedule view in calendar.
+ /// * [dayHeaderSettings], which used to customize the day header view of the
+ /// schedule view in calendar.
+ /// * [hideEmptyScheduleWeek], which used to hide the week header if the week
+ /// doesn't have any appointment on it.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -113,6 +151,15 @@ class ScheduleViewSettings with Diagnosticable {
/// [DayHeaderSettings.dayTextStyle] and [DayHeaderSettings.dateTextStyle] in
/// day label style of schedule view in calendar.
///
+ /// See also:
+ /// * [weekHeaderSettings], which used to customize the week header view
+ /// of the schedule view in calendar.
+ /// * [monthHeaderSettings], which used to customize the month header view of
+ /// the schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -149,6 +196,15 @@ class ScheduleViewSettings with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [appointmentItemHeight], which is the size for the appointment view in
+ /// the schedule view of calendar.
+ /// * [SfCalendar.appointmentBuilder], which used to set custom widget for
+ /// appointment view in calendar
+ /// * Knowledge base: [How to customize appointment height in schedule view](https://www.syncfusion.com/kb/12226/how-to-customize-the-appointment-height-in-schedule-view-of-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -171,6 +227,17 @@ class ScheduleViewSettings with Diagnosticable {
/// view of [SfCalendar],.
///
/// Defaults to `-1`.
+ ///
+ /// See also:
+ /// * [appointmentTextStyle], which used to customize the text style for the
+ /// text on the appointment view in calendar.
+ /// * [SfCalendar.appointmentBuilder], which used to set custom widget for
+ /// appointment view in calendar
+ /// * Knowledge base: [How to customize appointment height in schedule view](https://www.syncfusion.com/kb/12226/how-to-customize-the-appointment-height-in-schedule-view-of-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
+ ///
/// ``` dart
///
/// @override
@@ -192,6 +259,16 @@ class ScheduleViewSettings with Diagnosticable {
///
/// Defaults to false.
///
+ /// See more:
+ /// * [weekHeaderSettings], which used to customize the week header view
+ /// of the schedule view in calendar.
+ /// * [appointmentItemHeight], which is the size for the appointment view in
+ /// the schedule view of calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -265,6 +342,18 @@ class ScheduleViewSettings with Diagnosticable {
/// [backgroundColor] and [monthTextStyle] in month label style of schedule view
/// in calendar.
///
+/// See also:
+/// * [WeekHeaderSettings], which used to customize the week header view
+/// of the schedule view in calendar.
+/// * [DayHeaderSettings], which used to customize the day header view of the
+/// schedule view in calendar.
+/// * [SfCalendar.scheduleViewMonthHeaderBuilder], which used to set custom
+/// widget for month header view of schedule view in calendar.
+/// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+/// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+///
/// ``` dart
///
///@override
@@ -306,6 +395,18 @@ class MonthHeaderSettings with Diagnosticable {
///
/// Defaults to `MMMM yyyy`.
///
+ /// See also:
+ /// * [monthTextStyle], which used to customize the text style for the text
+ /// in the month header view in calendar.
+ /// * [textAlign], which aligns the month header text in the month header view
+ /// of calendar.
+ /// * [SfCalendar.scheduleViewMonthHeaderBuilder], which used to set custom
+ /// widget for month header view of schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -328,6 +429,16 @@ class MonthHeaderSettings with Diagnosticable {
///
/// Defaults to `150`.
///
+ /// See also:
+ /// * [backgroundColor], which fills the background of the month header view
+ /// of schedule view in calendar.
+ /// * [SfCalendar.scheduleViewMonthHeaderBuilder], which used to set custom
+ /// widget for month header view of schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -349,6 +460,18 @@ class MonthHeaderSettings with Diagnosticable {
///
/// Defaults to `TextAlign.center`.
///
+ /// See also:
+ /// * [monthTextStyle], which used to customize the text style for the text
+ /// in the month header view in calendar.
+ /// * [monthFormat], which formats the text on the month header view of
+ /// schedule view in calendar.
+ /// * [SfCalendar.scheduleViewMonthHeaderBuilder], which used to set custom
+ /// widget for month header view of schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -374,6 +497,16 @@ class MonthHeaderSettings with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [height], which is the size for the month header view of schedule view
+ /// in calendar.
+ /// * [SfCalendar.scheduleViewMonthHeaderBuilder], which used to set custom
+ /// widget for month header view of schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -399,6 +532,18 @@ class MonthHeaderSettings with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [textAlign], which aligns the month header text in the month header view
+ /// of calendar.
+ /// * [monthFormat], which formats the text on the month header view of
+ /// schedule view in calendar.
+ /// * [SfCalendar.scheduleViewMonthHeaderBuilder], which used to set custom
+ /// widget for month header view of schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -463,6 +608,17 @@ class MonthHeaderSettings with Diagnosticable {
/// [textAlign], [backgroundColor] and [weekTextStyle] in week label style of
/// schedule view in calendar.
///
+/// See also:
+/// * [MonthHeaderSettings], which used to customize the month header view
+/// of the schedule view in calendar.
+/// * [DayHeaderSettings], which used to customize the day header view of the
+/// schedule view in calendar.
+/// * [ScheduleViewSettings.hideEmptyScheduleWeek], which used to hide the week
+/// header if the week doesn't have any appointment on it.
+/// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+/// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+///
/// ``` dart
///
/// @override
@@ -507,6 +663,17 @@ class WeekHeaderSettings with Diagnosticable {
///
/// Defaults to null.
///
+ /// See also:
+ /// * [endDateFormat], which used to format the end date text in the week
+ /// header view of schedule view in calendar.
+ /// * [textAlign], which used to align the text on the week header view of
+ /// schedule view in calendar.
+ /// * [weekTextStyle], which used to customize the text style for the text in
+ /// the week header view of schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -530,6 +697,17 @@ class WeekHeaderSettings with Diagnosticable {
///
/// Defaults to null.
///
+ /// See also:
+ /// * [startDateFormat], which used to format the start date text in the week
+ /// header view of schedule view in calendar.
+ /// * [textAlign], which used to align the text on the week header view of
+ /// schedule view in calendar.
+ /// * [weekTextStyle], which used to customize the text style for the text in
+ /// the week header view of schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -553,6 +731,21 @@ class WeekHeaderSettings with Diagnosticable {
///
/// Defaults to `30`.
///
+ /// See also:
+ /// * [backgroundColor], which used to fill the background of the week header
+ /// view in the schedule view of calendar.
+ /// * [weekTextStyle], which used to customize the text style for the text in
+ /// the week header view of schedule view in calendar.
+ /// * [startDateFormat], which used to format the start date text in the week
+ /// header view of schedule view in calendar.
+ /// * [endDateFormat], which used to format the end date text in the week
+ /// header view of schedule view in calendar.
+ /// * [textAlign], which used to align the text on the week header view of
+ /// schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -576,6 +769,21 @@ class WeekHeaderSettings with Diagnosticable {
///
/// Defaults to `TextAlign.start`.
///
+ /// See also:
+ /// * [backgroundColor], which used to fill the background of the week header
+ /// view in the schedule view of calendar.
+ /// * [weekTextStyle], which used to customize the text style for the text in
+ /// the week header view of schedule view in calendar.
+ /// * [startDateFormat], which used to format the start date text in the week
+ /// header view of schedule view in calendar.
+ /// * [endDateFormat], which used to format the end date text in the week
+ /// header view of schedule view in calendar.
+ /// * [height], which is the size for the week header view in the schedule
+ /// view of calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -601,6 +809,21 @@ class WeekHeaderSettings with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [height], which is the size for the week header view in the schedule
+ /// view of calendar.
+ /// * [weekTextStyle], which used to customize the text style for the text in
+ /// the week header view of schedule view in calendar.
+ /// * [startDateFormat], which used to format the start date text in the week
+ /// header view of schedule view in calendar.
+ /// * [endDateFormat], which used to format the end date text in the week
+ /// header view of schedule view in calendar.
+ /// * [textAlign], which used to align the text on the week header view of
+ /// schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -626,6 +849,21 @@ class WeekHeaderSettings with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [backgroundColor], which used to fill the background of the week header
+ /// view in the schedule view of calendar.
+ /// * [height], which is the size for the week header view in the schedule
+ /// view of calendar.
+ /// * [startDateFormat], which used to format the start date text in the week
+ /// header view of schedule view in calendar.
+ /// * [endDateFormat], which used to format the end date text in the week
+ /// header view of schedule view in calendar.
+ /// * [textAlign], which used to align the text on the week header view of
+ /// schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -689,6 +927,15 @@ class WeekHeaderSettings with Diagnosticable {
/// Allows to customize the [dayFormat], [width], [dayTextStyle]
/// and [dateTextStyle] in day label style of schedule view in calendar.
///
+/// See also:
+/// * [WeekHeaderSettings], which used to customize the week header view
+/// of the schedule view in calendar.
+/// * [MonthHeaderSettings], which used to customize the month header view of
+/// the schedule view in calendar.
+/// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+/// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+///
/// ``` dart
///
/// @override
@@ -732,6 +979,15 @@ class DayHeaderSettings with Diagnosticable {
///
/// Defaults to `EEE`.
///
+ /// See also:
+ /// * [dayTextStyle], which used to customize the text style for the day text
+ /// in the day header of schedule view in calendar.
+ /// * [dateTextStyle], which used to customize the text style for the date
+ /// text in the day header of schedule view in calendar
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -753,6 +1009,17 @@ class DayHeaderSettings with Diagnosticable {
///
/// Defaults to `50`.
///
+ /// See also:
+ /// * [dayTextStyle], which used to customize the text style for the day text
+ /// in the day header of schedule view in calendar.
+ /// * [dateTextStyle], which used to customize the text style for the date
+ /// text in the day header of schedule view in calendar.
+ /// * [dayFormat], which used to format the day text in the day header view
+ /// of schedule view in calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -778,6 +1045,17 @@ class DayHeaderSettings with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [dateTextStyle], which used to customize the text style for the date
+ /// text in the day header of schedule view in calendar.
+ /// * [dayFormat], which used to format the day text in the day header view
+ /// of schedule view in calendar.
+ /// * [width], which is the size for the week header view of schedule view of
+ /// calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -808,6 +1086,17 @@ class DayHeaderSettings with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [dayTextStyle], which used to customize the text style for the day text
+ /// in the day header of schedule view in calendar.
+ /// * [dayFormat], which used to format the day text in the day header view
+ /// of schedule view in calendar.
+ /// * [width], which is the size for the week header view of schedule view of
+ /// calendar.
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/time_region.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/time_region.dart
index 107efe12b..f6ec5d814 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/time_region.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/time_region.dart
@@ -1,5 +1,7 @@
+import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
+import 'package:syncfusion_flutter_calendar/calendar.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart'
show IterableDiagnostics;
@@ -10,6 +12,18 @@ import 'package:syncfusion_flutter_datepicker/datepicker.dart'
/// Note: If time region have both the [text] and [iconData] then the region
/// will draw icon only.
///
+/// See also:
+/// * [SfCalendar.timeRegionBuilder], to set custom widget for the time regions
+/// in the calendar
+/// * [SfCalendar.specialRegions], which allows to set and handle the time
+/// region collection fo the calendar and date range picker.
+/// * Knowledge base: [How to customize special regions with builder](https://www.syncfusion.com/kb/12192/how-to-customize-the-special-time-region-using-custom-builder-in-the-flutter-calendar)
+/// * Knowledge base: [How to create time table](https://www.syncfusion.com/kb/12392/how-to-create-time-table-using-flutter-event-calendar)
+/// * Knowledge base: [How to add a special region dynamically using onTap and onViewChanged](https://www.syncfusion.com/kb/11729/how-to-add-a-special-region-dynamically-using-ontap-onviewchanged-callbacks-of-the-flutter)
+/// * Knowledge base: [How to use multiple recurrence rule in special region](https://www.syncfusion.com/kb/11730/how-to-use-multiple-recurrence-rule-rrule-in-special-region-using-flutter-calendar)
+/// * Knowledge base: [How to highlight the weekends](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+/// * Knowledge base: [How to highlight the lunch hours](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -56,6 +70,14 @@ class TimeRegion with Diagnosticable {
///
/// Defaults to 'DateTime.now()'.
///
+ /// See also:
+ /// * [endTime], the date time value in which the time region will end.
+ /// * [timeZone], the time zone for the time region, the region will be render
+ /// by converting the given time based on [timeZone] and
+ /// [SfCalendar.timeZone].
+ /// * [SfCalendar.timeZone], to set the timezone for the calendar.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -87,6 +109,14 @@ class TimeRegion with Diagnosticable {
///
/// Defaults to 'DateTime.now()'.
///
+ /// See also:
+ /// * [startTime], the date time value in which the time region will start.
+ /// * [timeZone], the time zone for the time region, the region will be render
+ /// by converting the given time based on [timeZone] and
+ /// [SfCalendar.timeZone].
+ /// * [SfCalendar.timeZone], to set the timezone for the calendar.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -117,6 +147,14 @@ class TimeRegion with Diagnosticable {
/// Note: If time region have both the text and icon data then it will draw
/// icon only.
///
+ /// See also:
+ /// * [iconData], the icon 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](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight the lunch hours](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add a special region dynamically using onTap and onViewChanged](https://www.syncfusion.com/kb/11729/how-to-add-a-special-region-dynamically-using-ontap-onviewchanged-callbacks-of-the-flutter)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -148,6 +186,17 @@ class TimeRegion with Diagnosticable {
///
/// Defaults to null.
///
+ /// See also;
+ /// * [RecurrenceProperties], which used to create the recurrence rule based
+ /// on the values set to these properties.
+ /// * [SfCalendar.generateRRule], which used to generate recurrence rule
+ /// based on the [RecurrenceProperties] values.
+ /// * [SfCalendar.getRecurrenceDateTimeCollection], to get the recurrence date
+ /// time collection based on the given recurrence rule and start date.
+ /// * Knowledge base: [How to use a negative value for bysetpos in rrule](https://www.syncfusion.com/kb/12552/how-to-use-a-negative-value-for-bysetpos-in-a-rrule-of-recurrence-appointment-in-the)
+ /// * Knowledge base: [How to get the recurrence date collection](https://www.syncfusion.com/kb/12344/how-to-get-the-recurrence-date-collection-in-the-flutter-calendar)
+ /// * Knowledge base: [How to use multiple recurrence rule in special region](https://www.syncfusion.com/kb/11730/how-to-use-multiple-recurrence-rule-rrule-in-special-region-using-flutter-calendar)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -178,6 +227,16 @@ class TimeRegion with Diagnosticable {
/// Used to specify the background color of [TimeRegion].
///
+ /// See also:
+ /// * [textStyle], which used to customize the style for the text on the
+ /// time region view.
+ /// * [iconData], the icon will which will be displayed on the time region
+ /// view.
+ /// * [SfCalendar.timeRegionBuilder], to set custom widget for the time
+ /// regions in the calendar
+ /// * Knowledge base: [How to customize special regions with builder](https://www.syncfusion.com/kb/12192/how-to-customize-the-special-time-region-using-custom-builder-in-the-flutter-calendar)
+ ///
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -216,6 +275,15 @@ class TimeRegion with Diagnosticable {
/// placed in the region.
/// 4. 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](https://www.syncfusion.com/kb/11729/how-to-add-a-special-region-dynamically-using-ontap-onviewchanged-callbacks-of-the-flutter)
+ /// * Knowledge base: [How to highlight the weekends](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight the lunch hours](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -243,6 +311,12 @@ class TimeRegion with Diagnosticable {
/// 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](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -271,6 +345,14 @@ class TimeRegion with Diagnosticable {
/// Used to specify the text style for [TimeRegion] text and icon.
///
+ /// See also:
+ /// * [color], which used to fill the background of the time region view.
+ /// * [iconData], the icon will which will be displayed on the time region
+ /// view.
+ /// * [SfCalendar.timeRegionBuilder], to set custom widget for the time
+ /// regions in the calendar
+ /// * Knowledge base: [How to customize special regions with builder](https://www.syncfusion.com/kb/12192/how-to-customize-the-special-time-region-using-custom-builder-in-the-flutter-calendar)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -303,6 +385,15 @@ class TimeRegion with Diagnosticable {
/// 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](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight the lunch hours](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add a special region dynamically using onTap and onViewChanged](https://www.syncfusion.com/kb/11729/how-to-add-a-special-region-dynamically-using-ontap-onviewchanged-callbacks-of-the-flutter)
+ ///
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -334,6 +425,16 @@ class TimeRegion with Diagnosticable {
/// [recurrenceRule]. If it is not empty, then recurrence region not applied
/// to specified collection of dates in [recurrenceExceptionDates].
///
+ /// See also:
+ /// * [recurrenceRule], which used to generate the recurrence time region
+ /// based on the rule set.
+ /// * [RecurrenceProperties], which used to create the recurrence rule based
+ /// on the values set to these properties.
+ /// * [SfCalendar.generateRRule], which used to generate recurrence rule
+ /// based on the [RecurrenceProperties] values.
+ /// * Knowledge base: [How to use multiple recurrence rule in special region](https://www.syncfusion.com/kb/11730/how-to-use-multiple-recurrence-rule-rrule-in-special-region-using-flutter-calendar)
+ /// * Knowledge base: [How to exclude the dates from the recurrence appointments](https://www.syncfusion.com/kb/12161/how-to-exclude-the-dates-from-recurrence-appointments-in-the-flutter-calendar)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -371,12 +472,14 @@ class TimeRegion with Diagnosticable {
/// resource in calendar view.
///
/// See also:
- ///
- /// * [CalendarResource], the resource data for calendar.
+ /// * [CalendarResource], object which contains the resource data.
/// * [ResourceViewSettings], the settings have properties which allow to
/// customize the resource view of the [SfCalendar].
/// * [CalendarResource.id], the unique id for the [CalendarResource] view of
/// [SfCalendar].
+ /// * [CalendarDataSource], which used to set the resources collection to the
+ /// calendar.
+ /// * Knowledge base: [How to add resources](https://www.syncfusion.com/kb/12070/how-to-add-resources-in-the-flutter-calendar)
///
///```dart
///
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/time_slot_view_settings.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/time_slot_view_settings.dart
index ba46ba0a5..cb6da7749 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/time_slot_view_settings.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/time_slot_view_settings.dart
@@ -1,5 +1,7 @@
+import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
+import 'package:syncfusion_flutter_calendar/calendar.dart';
/// The settings have properties which allow to customize the time slot views
/// of the [SfCalendar].
@@ -8,6 +10,25 @@ import 'package:flutter/material.dart';
/// [timeInterval], [timeIntervalHeight], [timeFormat], [dateFormat],[dayFormat]
/// and [timeRulerSize] in time slot views of calendar.
///
+/// See also:
+/// * [MonthViewSettings], to know more about the customization options for
+/// the month view of calendar.
+/// * [ScheduleViewSettings], to know more about the customization options for
+/// the schedule view of calendar.
+/// * [TimeRegion], which used to customize an particular cell in the timeslot
+/// views of calendar.
+/// * Knowledge base: [How to customize time label](https://www.syncfusion.com/kb/11008/how-to-customize-the-time-label-in-the-flutter-calendar)
+/// * Knowledge base: [How to change the time interval width and height](https://www.syncfusion.com/kb/12322/how-to-change-the-time-interval-width-and-height-in-the-flutter-event-calendar-sfcalendar)
+/// * Knowledge base: [How to set the arbitrary height to an appointment](https://www.syncfusion.com/kb/12279/how-to-set-the-arbitrary-height-to-appointments-in-the-flutter-calendar)
+/// * Knowledge base: [How to auto fit the calendar to screen height](https://www.syncfusion.com/kb/12231/how-to-autofit-the-calendar-to-screen-height-in-the-flutter-calendar)
+/// * Knowledge base: [How to customize the timeline appointment height](https://www.syncfusion.com/kb/12147/how-to-customize-the-timeline-appointment-height-in-the-flutter-calendar)
+/// * Knowledge base: [How to change working days and hours](https://www.syncfusion.com/kb/12146/how-to-change-the-working-days-and-hours-in-the-flutter-calendar)
+/// * Knowledge base: [How to format the view header day and date format](https://www.syncfusion.com/kb/12339/how-to-format-the-view-header-day-and-date-in-the-flutter-calendar)
+/// * Knowledge base: [How to add custom fonts](https://www.syncfusion.com/kb/12101/how-to-add-custom-fonts-in-the-flutter-calendar)
+/// * Knowledge base: [How to format the date and time in timeline views](https://www.syncfusion.com/kb/11997/how-to-format-the-date-and-time-in-timeline-views-in-the-flutter-calendar)
+/// * Knowledge base: [How to apply theming](https://www.syncfusion.com/kb/11899/how-to-apply-theming-in-flutter-calendar)
+/// * Knowledge base: [How to highlight working and non working hours](https://www.syncfusion.com/kb/11711/how-to-highlight-the-working-and-non-working-hours-in-the-flutter-calendar)
+///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -49,7 +70,8 @@ class TimeSlotViewSettings with Diagnosticable {
this.dateFormat = 'd',
this.dayFormat = 'EE',
this.timeRulerSize = -1,
- this.timeTextStyle})
+ this.timeTextStyle,
+ this.allDayPanelColor})
: assert(startHour >= 0 && startHour <= 24),
assert(endHour >= 0 && endHour <= 24),
assert(timeIntervalHeight >= -1),
@@ -64,6 +86,16 @@ class TimeSlotViewSettings with Diagnosticable {
///
/// Defaults to `0`.
///
+ /// See more:
+ /// * [endHour], which is the end hour for the time slot views in calendar.
+ /// * [TimeRegion], which allows to customize the particular time region in
+ /// the timeslot views of calendar.
+ /// * [nonWorkingDays], which restricts the rendering of mentioned week days,
+ /// in the [CalendarView.workWeek] and [CalendarView.timelineWorkWeek] views
+ /// of calendar.
+ /// * Knowledge base: [How to change working days and hours](https://www.syncfusion.com/kb/12146/how-to-change-the-working-days-and-hours-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight working and non working hours](https://www.syncfusion.com/kb/11711/how-to-highlight-the-working-and-non-working-hours-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -96,6 +128,17 @@ class TimeSlotViewSettings with Diagnosticable {
///
/// Defaults to `24`.
///
+ /// See more:
+ /// * [startHour], which is the start hour for the time slot views in
+ /// calendar.
+ /// * [TimeRegion], which allows to customize the particular time region in
+ /// the timeslot views of calendar.
+ /// * [nonWorkingDays], which restricts the rendering of mentioned week days,
+ /// in the [CalendarView.workWeek] and [CalendarView.timelineWorkWeek] views
+ /// of calendar.
+ /// * Knowledge base: [How to change working days and hours](https://www.syncfusion.com/kb/12146/how-to-change-the-working-days-and-hours-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight working and non working hours](https://www.syncfusion.com/kb/11711/how-to-highlight-the-working-and-non-working-hours-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -129,6 +172,16 @@ class TimeSlotViewSettings with Diagnosticable {
/// _Note:_ This is only applicable only when the calendar view set as
/// [CalendarView.workWeek] or [CalendarView.timelineWorkWeek] view.
///
+ /// See also:
+ /// * [startHour], which is the start hour for the timeslot views of the
+ /// calendar.
+ /// * [endHour], which is the end hour for the timeslot view of the calendar.
+ /// * [TimeRegion], which is used to customize the specific time region in the
+ /// timeslot views of the calendar.
+ /// * Knowledge base: [How to change working days and hours](https://www.syncfusion.com/kb/12146/how-to-change-the-working-days-and-hours-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight working and non working hours](https://www.syncfusion.com/kb/11711/how-to-highlight-the-working-and-non-working-hours-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight the weekends](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -200,6 +253,18 @@ class TimeSlotViewSettings with Diagnosticable {
///
/// This property applicable only for day, week and work week view of calendar
///
+ /// See also:
+ /// * [timeInterval], which is the duration of every single timeslot in the
+ /// timeslot views of calendar.
+ /// * [timeIntervalWidth], which is the width for every single timeslot in
+ /// the timeline views of calendar.
+ /// * [minimumAppointmentDuration], which is the minimum duration for the
+ /// appointment, if the appointment duration is too small to display on view.
+ /// * Knowledge base: [How to change the time interval width and height](https://www.syncfusion.com/kb/12322/how-to-change-the-time-interval-width-and-height-in-the-flutter-event-calendar-sfcalendar)
+ /// * Knowledge base: [How to set the arbitrary height to an appointment](https://www.syncfusion.com/kb/12279/how-to-set-the-arbitrary-height-to-appointments-in-the-flutter-calendar)
+ /// * Knowledge base: [How to auto fit the calendar to screen height](https://www.syncfusion.com/kb/12231/how-to-autofit-the-calendar-to-screen-height-in-the-flutter-calendar)
+ /// * To know more about time slot views in calendar [refer here](https://help.syncfusion.com/flutter/calendar/timeslot-views)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -232,7 +297,19 @@ class TimeSlotViewSettings with Diagnosticable {
/// auto-fit to the screen width.
///
/// See also:
- /// To know more about time slot views in calendar [refer here](https://help.syncfusion.com/flutter/calendar/timeslot-views)
+ /// * [timeInterval], which is the duration of every single timeslot in the
+ /// timeslot views of calendar.
+ /// * [timeIntervalHeight], which is the height for every single timeslot in
+ /// the day,week and work week views of calendar.
+ /// * [minimumAppointmentDuration], which is the minimum duration for the
+ /// appointment, if the appointment duration is too small to display on view.
+ /// * [timelineAppointmentHeight], which is the height for appointment view
+ /// in the timeline views of calendar.
+ /// * Knowledge base: [How to change the time interval width and height](https://www.syncfusion.com/kb/12322/how-to-change-the-time-interval-width-and-height-in-the-flutter-event-calendar-sfcalendar)
+ /// * Knowledge base: [How to set the arbitrary height to an appointment](https://www.syncfusion.com/kb/12279/how-to-set-the-arbitrary-height-to-appointments-in-the-flutter-calendar)
+ /// * Knowledge base: [How to auto fit the calendar to screen height](https://www.syncfusion.com/kb/12231/how-to-autofit-the-calendar-to-screen-height-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the timeline appointment height](https://www.syncfusion.com/kb/12147/how-to-customize-the-timeline-appointment-height-in-the-flutter-calendar)
+ /// * To know more about time slot views in calendar [refer here](https://help.syncfusion.com/flutter/calendar/timeslot-views)
///
/// ```dart
///Widget build(BuildContext context) {
@@ -258,6 +335,25 @@ class TimeSlotViewSettings with Diagnosticable {
///
/// Defaults to `h a`.
///
+ /// See also:
+ /// * [timeTextStyle], which is the text style for the time text in the
+ /// timeslot views of calendar.
+ /// * [timeRulerSize], which is the size for the time ruler, which displays
+ /// the time label in timeslot views of calendar.
+ /// * [timeInterval], which is the duration of every single timeslot in the
+ /// timeslot views of calendar.
+ /// * [startHour], which is the start hour for the timeslot views of the
+ /// calendar.
+ /// * [endHour], which is the end hour for the timeslot view of the calendar.
+ /// * [dayFormat], which is the format for the day text in view header view
+ /// of the timeslot views in calendar.
+ /// * [dateFormat], which is the format for the date text in the view header
+ /// view of the timeslot views of calendar.
+ /// * Knowledge base: [How to customize time label](https://www.syncfusion.com/kb/11008/how-to-customize-the-time-label-in-the-flutter-calendar)
+ /// * Knowledge base: [How to change the time interval width and height](https://www.syncfusion.com/kb/12322/how-to-change-the-time-interval-width-and-height-in-the-flutter-event-calendar-sfcalendar)
+ /// * Knowledge base: [How to format the view header day and date format](https://www.syncfusion.com/kb/12339/how-to-format-the-view-header-day-and-date-in-the-flutter-calendar)
+ /// * Knowledge base: [How to format the date and time in timeline views](https://www.syncfusion.com/kb/11997/how-to-format-the-date-and-time-in-timeline-views-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -290,6 +386,18 @@ class TimeSlotViewSettings with Diagnosticable {
/// [CalendarView.timelineDay], [CalendarView.timelineWeek] and
/// [CalendarView.timelineWorkWeek] view in [SfCalendar].
///
+ /// See also:
+ /// * [timeInterval], which is the duration of every single timeslot in the
+ /// timeslot views of calendar.
+ /// * [minimumAppointmentDuration], which is the minimum duration for the
+ /// appointment, if the appointment duration is too small to display on view.
+ /// * [timeIntervalWidth], which is the width for every single timeslot in
+ /// the day,week and work week views of calendar.
+ /// * Knowledge base: [How to change the time interval width and height](https://www.syncfusion.com/kb/12322/how-to-change-the-time-interval-width-and-height-in-the-flutter-event-calendar-sfcalendar)
+ /// * Knowledge base: [How to set the arbitrary height to an appointment](https://www.syncfusion.com/kb/12279/how-to-set-the-arbitrary-height-to-appointments-in-the-flutter-calendar)
+ /// * Knowledge base: [How to auto fit the calendar to screen height](https://www.syncfusion.com/kb/12231/how-to-autofit-the-calendar-to-screen-height-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the timeline appointment height](https://www.syncfusion.com/kb/12147/how-to-customize-the-timeline-appointment-height-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -324,6 +432,19 @@ class TimeSlotViewSettings with Diagnosticable {
/// _Note:_ The value set to this property will be applicable, only when an
/// [Appointment] duration value lesser than this property.
///
+ /// See also:
+ /// * [timeInterval], which is the duration of every single timeslot in the
+ /// timeslot views of calendar.
+ /// * [timeIntervalWidth], which is the width for every single timeslot in
+ /// the timeline views of calendar.
+ /// * [timeIntervalHeight], which is the height for every single timeslot in
+ /// the timeline views of calendar.
+ /// * [timelineAppointmentHeight], which is the height for appointment view
+ /// in the timeline views of calendar.
+ /// * Knowledge base: [How to change the time interval width and height](https://www.syncfusion.com/kb/12322/how-to-change-the-time-interval-width-and-height-in-the-flutter-event-calendar-sfcalendar)
+ /// * Knowledge base: [How to set the arbitrary height to an appointment](https://www.syncfusion.com/kb/12279/how-to-set-the-arbitrary-height-to-appointments-in-the-flutter-calendar)
+ /// * Knowledge base: [How to auto fit the calendar to screen height](https://www.syncfusion.com/kb/12231/how-to-autofit-the-calendar-to-screen-height-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -355,6 +476,15 @@ class TimeSlotViewSettings with Diagnosticable {
///
/// Defaults to `EE`.
///
+ /// See also:
+ /// * [timeTextStyle], which is the text style for the time text in the
+ /// timeslot views of calendar.
+ /// * [dayFormat], which is the format for the day text in view header view
+ /// of the timeslot views in calendar.
+ /// * [ViewHeaderStyle], which is used to customize the view header view of
+ /// the calendar.
+ /// * Knowledge base: [How to format the view header day and date format](https://www.syncfusion.com/kb/12339/how-to-format-the-view-header-day-and-date-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -385,6 +515,15 @@ class TimeSlotViewSettings with Diagnosticable {
///
/// Defaults to `d`.
///
+ /// See also:
+ /// * [timeTextStyle], which is the text style for the time text in the
+ /// timeslot views of calendar.
+ /// * [dateFormat], which is the format for the date text in view header view
+ /// of the timeslot views in calendar.
+ /// * [ViewHeaderStyle], which is used to customize the view header view of
+ /// the calendar.
+ /// * Knowledge base: [How to format the view header day and date format](https://www.syncfusion.com/kb/12339/how-to-format-the-view-header-day-and-date-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -415,6 +554,16 @@ class TimeSlotViewSettings with Diagnosticable {
///
/// Defaults to `-1`.
///
+ /// See also:
+ /// * [timeTextStyle], which is the text style for the time text in the
+ /// timeslot views of calendar.
+ /// * [timeFormat], which used to format the time text in the timeslot views
+ /// of calendar.
+ /// * [timeInterval], which is the duration of every single timeslot in the
+ /// timeslot views of calendar.
+ /// * Knowledge base: [How to customize time label](https://www.syncfusion.com/kb/11008/how-to-customize-the-time-label-in-the-flutter-calendar)
+ /// * Knowledge base: [How to format the date and time in timeline views](https://www.syncfusion.com/kb/11997/how-to-format-the-date-and-time-in-timeline-views-in-the-flutter-calendar)
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -447,6 +596,18 @@ class TimeSlotViewSettings with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [timeFormat], which is used to format the time text in the timeslotviews
+ /// of the calendar.
+ /// * [timeRulerSize], which is the size for the time ruler, which displays
+ /// the time label in timeslot views of calendar.
+ /// * [timeInterval], which is the duration of every single timeslot in the
+ /// timeslot views of calendar.
+ /// * Knowledge base: [How to customize time label](https://www.syncfusion.com/kb/11008/how-to-customize-the-time-label-in-the-flutter-calendar)
+ /// * Knowledge base: [How to change the time interval width and height](https://www.syncfusion.com/kb/12322/how-to-change-the-time-interval-width-and-height-in-the-flutter-event-calendar-sfcalendar)
+ /// * Knowledge base: [How to format the view header day and date format](https://www.syncfusion.com/kb/12339/how-to-format-the-view-header-day-and-date-in-the-flutter-calendar)
+ /// * Knowledge base: [How to format the date and time in timeline views](https://www.syncfusion.com/kb/11997/how-to-format-the-date-and-time-in-timeline-views-in-the-flutter-calendar)
+ ///
/// ```dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -476,6 +637,33 @@ class TimeSlotViewSettings with Diagnosticable {
/// ```
final TextStyle? timeTextStyle;
+ /// The color which fills the [SfCalendar] all day panel background.
+ ///
+ /// Defaults to null.
+ ///
+ /// Using a [SfCalendarTheme] gives more fine-grained control over the
+ /// appearance of various components of the calendar.
+ ///
+ /// See also:
+ /// * [backgroundColor], will fill the background of the calendar.
+ /// *[CalendarHeaderStyle.backgroundColor], will fill the header background
+ /// of the calendar.
+ /// *[ViewHeaderStyle.backgroundColor], will fill the view header background
+ /// of the calendar.
+ ///
+ /// ```dart
+ ///Widget build(BuildContext context) {
+ /// return Container(
+ /// child: SfCalendar(
+ /// view: CalendarView.week,
+ /// timeSlotViewSettings: TimeSlotViewSettings(
+ /// allDayPanelColor : Colors.green),
+ /// ),
+ /// );
+ /// }
+ /// ```
+ final Color? allDayPanelColor;
+
@override
bool operator ==(dynamic other) {
if (identical(this, other)) {
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/view_header_style.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/view_header_style.dart
index 2a865f64d..0c13a6dc8 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/view_header_style.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/view_header_style.dart
@@ -8,6 +8,13 @@ import 'package:flutter/material.dart';
///
/// 
///
+/// See also:
+/// * [SfCalendar.viewHeaderHeight], to customize the size of the view header
+/// view in calendar.
+/// * Knowledge base: [How to format day and date of view header](https://www.syncfusion.com/kb/12339/how-to-format-the-view-header-day-and-date-in-the-flutter-calendar)
+/// * Knowledge base: [How to add custom header and view header](https://www.syncfusion.com/kb/10997/how-to-add-custom-header-and-view-header-in-the-flutter-calendar)
+/// * Knowledge base: [How to highlight tapped date in view header](https://www.syncfusion.com/kb/12469/how-to-highlight-the-tapped-view-header-in-the-flutter-calendar)
+///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -38,6 +45,15 @@ class ViewHeaderStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [dayTextStyle], which used to customize the text style of the day text
+ /// in the view header view.
+ /// * [dateTextStyle], which used to customize the text style of the date text
+ /// in the view header view.
+ /// * [SfCalendar.viewHeaderHeight], which customizes the size of the view
+ /// header view in the calendar.
+ ///
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -66,6 +82,12 @@ class ViewHeaderStyle with Diagnosticable {
/// The text color set to this doesn't apply for the today cell in view header
/// of day/week/workweek view.
///
+ /// See also:
+ /// * [dayTextStyle], which used to customize the text style of the day text
+ /// in the view header view.
+ /// * [backgroundColor], which fills the background of the view header view
+ /// in calendar.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -88,6 +110,12 @@ class ViewHeaderStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [dateTextStyle], which used to customize the text style of the date text
+ /// in the view header view.
+ /// * [backgroundColor], which fills the background of the view header view
+ /// in calendar.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/week_number_style.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/week_number_style.dart
index 15e16ba49..c2a6196d1 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/week_number_style.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/settings/week_number_style.dart
@@ -35,6 +35,10 @@ class WeekNumberStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar
///
+ /// See also:
+ /// * [textStyle], which used to apply style for the text in the week number
+ /// view in calendar.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
@@ -57,6 +61,10 @@ class WeekNumberStyle with Diagnosticable {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [backgroundColor], which used to fill the background of the weeknumber
+ /// panel in the calendar.
+ ///
/// ```dart
///Widget build(BuildContext context) {
/// return Container(
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/sfcalendar.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/sfcalendar.dart
index 7196f2e0e..aa9c8ae46 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/sfcalendar.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/sfcalendar.dart
@@ -1,13 +1,13 @@
import 'dart:math' as math;
import 'dart:ui';
+import 'package:flutter/cupertino.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
-
import 'package:intl/date_symbol_data_local.dart';
import 'package:intl/intl.dart' show DateFormat;
import 'package:syncfusion_flutter_core/core.dart';
@@ -29,6 +29,7 @@ import 'common/enums.dart';
import 'common/event_args.dart';
import 'resource_view/calendar_resource.dart';
import 'resource_view/resource_view.dart';
+import 'settings/drag_and_drop_settings.dart';
import 'settings/header_style.dart';
import 'settings/month_view_settings.dart';
import 'settings/resource_view_settings.dart';
@@ -99,15 +100,21 @@ typedef _CalendarHeaderCallback = void Function(double width);
/// {@youtube 560 315 https://www.youtube.com/watch?v=3OROjbAQS8Y}
///
/// See also:
-/// [SfCalendarThemeData]
-/// [CalendarHeaderStyle]
-/// [ViewHeaderStyle]
-/// [MonthViewSettings]
-/// [TimeSlotViewSettings]
-/// [ResourceViewSettings]
-/// [ScheduleViewSettings]
-/// [MonthCellStyle]
-/// [AgendaStyle].
+/// * [SfCalendarThemeData], to set consistent look for calendar elements.
+/// * [CalendarHeaderStyle], to customize the header view of the calendar.
+/// * [ViewHeaderStyle], to customize the view header view of the calendar.
+/// * [MonthViewSettings], to customize the month view of the calendar.
+/// * [TimeSlotViewSettings], to customize the timeslot views of the calendar.
+/// * [ResourceViewSettings], to customize the resource view of the calendar.
+/// * [ScheduleViewSettings], to customize the schedule view of the calendar.
+/// * [MonthCellStyle], to customize the month cells of the calendar.
+/// * [AgendaStyle], to customize the month agenda view of the calendar.
+/// * [showDatePickerButton], to show date picker for quickly navigating to a
+/// different date.
+/// * [allowedViews], to show list of calendar views on header view for quick
+/// navigation.
+/// * [SfDateRangePicker], material widget, which used to select date, dates,
+/// range, and ranges of dates.
///
///
/// ```dart
@@ -198,7 +205,7 @@ class SfCalendar extends StatefulWidget {
this.showDatePickerButton = false,
this.allowViewNavigation = false,
this.showCurrentTimeIndicator = true,
- this.cellEndPadding = 1,
+ this.cellEndPadding = -1,
this.viewNavigationMode = ViewNavigationMode.snap,
this.allowedViews,
this.specialRegions,
@@ -207,12 +214,21 @@ class SfCalendar extends StatefulWidget {
this.showWeekNumber = false,
this.weekNumberStyle = const WeekNumberStyle(),
this.resourceViewHeaderBuilder,
+ this.allowAppointmentResize = false,
+ this.onAppointmentResizeStart,
+ this.onAppointmentResizeUpdate,
+ this.onAppointmentResizeEnd,
+ this.allowDragAndDrop = false,
+ this.dragAndDropSettings = const DragAndDropSettings(),
+ this.onDragStart,
+ this.onDragUpdate,
+ this.onDragEnd,
}) : assert(firstDayOfWeek >= 1 && firstDayOfWeek <= 7),
assert(headerHeight >= 0),
assert(viewHeaderHeight >= -1),
assert(minDate == null || maxDate == null || minDate.isBefore(maxDate)),
assert(minDate == null || maxDate == null || maxDate.isAfter(minDate)),
- assert(cellEndPadding >= 0),
+ assert(cellEndPadding >= -1),
initialDisplayDate = initialDisplayDate ??
DateTime(DateTime.now().year, DateTime.now().month,
DateTime.now().day, 08, 45, 0),
@@ -228,17 +244,22 @@ class SfCalendar extends StatefulWidget {
/// With this builder, you can set widget and then initiate the process of
/// loading more appointments by calling ‘loadMoreAppointments’ callback
/// which is passed as a parameter to this builder. The ‘loadMoreAppointments’
- /// will inturn call the [CalendarDataSource.handleLoadMore' method, where you
- /// have to load the appointments.
+ /// will in turn call the [CalendarDataSource.handleLoadMore' method, where
+ /// you have to load the appointments.
///
/// The widget returned from this builder will be rendered based on calendar
/// widget width and height.
///
- /// Note: This callback will be called after the onViewChanged callback.
+ /// _Note:_ This callback will be called after the onViewChanged callback.
/// The widget returned from this builder will be removed from [SfCalendar]
/// when [CalendarDataSource.notifyListeners] is called.
///
- /// See also: [CalendarDataSource.handleLoadMore]
+ /// See also:
+ /// * [CalendarDataSource.handleLoadMore], to handle the appointment loading,
+ /// when the indicator is displaying.
+ /// * [CalendarDataSource.notifyListeners], to add, remove or reset the
+ /// appointment collection.
+ /// * Knowledge base: [How to load appointments on demand](https://www.syncfusion.com/kb/12658/how-to-load-appointments-on-demand-in-flutter-calendar)
///
/// ``` dart
/// @override
@@ -279,7 +300,12 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to null.
///
- /// See also: [SfCalendar.onViewChanged]
+ /// See also:
+ /// * [SfCalendar.onViewChanged], the callback to notify that the view
+ /// changed, this also contains the visible dates collection.
+ /// * [view], to specify the view to be rendered on initially in calendar.
+ /// * [CalendarController.view], to change the calendar view dynamically.
+ /// * Knowledge base: [How to do date navigates easily](https://www.syncfusion.com/kb/12019/how-to-do-date-navigations-easily-with-flutter-calendar)
///
/// ``` dart
/// Widget build(BuildContext context) {
@@ -303,11 +329,15 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to 'false'.
///
- /// See also: [showDatePickerButton], to show date picker for quickly
- /// navigating to a different date. [allowedViews] to show list of calendar
- /// views on header view for quick navigation.
+ /// See also:
+ /// * [showDatePickerButton], to show date picker for quickly navigating to a
+ /// different date.
+ /// * [allowedViews] to show list of calendar views on header view for quick
+ /// navigation.
+ /// * Knowledge base: [How to switch between views](https://www.syncfusion.com/kb/10944/how-to-switch-between-views-of-the-flutter-calendar)
///
/// ``` dart
+ ///
/// Widget build(BuildContext context) {
/// return Container(
/// child: SfCalendar(
@@ -327,6 +357,13 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to `false`.
///
+ /// see also:
+ /// * [allowedViews] to show list of calendar views on header view for quick
+ /// navigation.
+ /// * [SfDateRangePicker], material widget which displays on the header of
+ /// calendar, when the header date tapped.
+ /// * [How to add indicator in month cells of date range picker](https://www.syncfusion.com/kb/12119/how-to-add-the-indicator-in-the-month-cells-of-the-date-range-picker-sfdaterangepicker-when)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -346,6 +383,10 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to `true`.
///
+ /// see also:
+ /// * [todayHighlightColor], to customize the color of the indicator.
+ ///
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -362,7 +403,17 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to `CalendarView.day`.
///
- /// Also refer: [CalendarView].
+ /// See also:
+ /// * [CalendarView], to know about available calendar views.
+ /// * [SfCalendar.onViewChanged], the callback to notify that the view
+ /// changed, this also contains the visible dates collection.
+ /// * [CalendarController.view], to change the calendar view dynamically.
+ /// * [showDatePickerButton], to show date picker for quickly navigating to a
+ /// different date.
+ /// * [allowedViews] to show list of calendar views on header view for quick
+ /// navigation.
+ /// * Knowledge base: [How to switch between views](https://www.syncfusion.com/kb/10944/how-to-switch-between-views-of-the-flutter-calendar)
+ ///
///
/// ``` dart
///Widget build(BuildContext context) {
@@ -389,8 +440,10 @@ class SfCalendar extends StatefulWidget {
/// render dates based on the date set to this property.
///
/// See also:
- /// [initialDisplayDate].
- /// [maxDate].
+ /// * [initialDisplayDate], the date which displayed initially on calendar.
+ /// * [maxDate], which is the maximum available date for the calendar.
+ /// * [CalendarController.displayDate], which move to the desired date
+ /// dynamically.
///
/// ``` dart
///Widget build(BuildContext context) {
@@ -418,8 +471,10 @@ class SfCalendar extends StatefulWidget {
/// render dates based on the date set to this property.
///
/// See also:
- /// [initialDisplayDate].
- /// [minDate].
+ /// * [initialDisplayDate], the date which displayed initially on calendar.
+ /// * [minDate], which is the least available date for the calendar.
+ /// * [CalendarController.displayDate], which move to the desired date
+ /// dynamically.
///
/// ``` dart
///
@@ -438,8 +493,13 @@ class SfCalendar extends StatefulWidget {
/// A builder that builds a widget, replaces the month cell in the
/// calendar month view.
///
- /// Note: Month cell appointments are not shown when the month cell builder,
- /// builds the custom widget for month view.
+ /// See also:
+ /// * [MonthViewSettings.appointmentDisplayMode], to customize the appointment
+ /// display mode in the month cell.
+ /// * [appointmentBuilder], to build custom widget for appointments in
+ /// calendar.
+ /// * Knowledge base: [How to customize month cells](https://www.syncfusion.com/kb/12016/how-to-customize-the-month-cells-of-the-flutter-calendar)
+ /// * Knowledge base: [How to customize month cell with appointment count](https://www.syncfusion.com/kb/12306/how-to-customize-the-month-cell-with-appointment-count-in-the-flutter-calendar)
///
/// ```dart
///@override
@@ -466,11 +526,19 @@ class SfCalendar extends StatefulWidget {
/// week, workweek, month, schedule and timeline day, week, workweek,
/// month views.
///
- /// Note: In month view, this builder callback will be used to build
+ /// _Note:_ In month view, this builder callback will be used to build
/// appointment views for appointments displayed in both month cell and
/// agenda views when the MonthViewSettings.appointmentDisplayMode is
/// set to appointment.
///
+ /// See also:
+ /// * [CalendarDataSource], to set and handle the appointments in the calendar
+ /// * [Appointment], to know more about the appointment and it's properties in
+ /// calendar.
+ /// * [appointmentTextStyle], to customize the appointment text, when the
+ /// builder not added.
+ /// * Knowledge base: [How to customize appointment using builder](https://www.syncfusion.com/kb/12191/how-to-customize-the-appointments-using-custom-builder-in-the-flutter-calendar)
+ ///
/// ```dart
/// CalendarController _controller = CalendarController();
///
@@ -544,6 +612,13 @@ class SfCalendar extends StatefulWidget {
/// A builder that builds a widget that replaces the time region view in day,
/// week, workweek, and timeline day, week, workweek views.
///
+ /// See also:
+ /// * [specialRegions], to set the special time regions in the calendar.
+ /// * [TimeRegion], to now the details about the special time regions and it's
+ /// properties in calendar.
+ /// * Knowledge base: [How to customize special regions with builder](https://www.syncfusion.com/kb/12192/how-to-customize-the-special-time-region-using-custom-builder-in-the-flutter-calendar)
+ ///
+ ///
/// ```dart
///
/// List _getTimeRegions() {
@@ -597,55 +672,58 @@ class SfCalendar extends StatefulWidget {
/// If it does not match, the provided string will be used as-is.
/// The supported sets of skeletons are as follows.
///
- /// ICU Name Skeleton
- /// -------- --------
- /// DAY d
- /// ABBR_WEEKDAY E
- /// WEEKDAY EEEE
- /// ABBR_STANDALONE_MONTH LLL
- /// STANDALONE_MONTH LLLL
- /// NUM_MONTH M
- /// NUM_MONTH_DAY Md
- /// NUM_MONTH_WEEKDAY_DAY MEd
- /// ABBR_MONTH MMM
- /// ABBR_MONTH_DAY MMMd
- /// ABBR_MONTH_WEEKDAY_DAY MMMEd
- /// MONTH MMMM
- /// MONTH_DAY MMMMd
- /// MONTH_WEEKDAY_DAY MMMMEEEEd
- /// ABBR_QUARTER QQQ
- /// QUARTER QQQQ
- /// YEAR y
- /// YEAR_NUM_MONTH yM
- /// YEAR_NUM_MONTH_DAY yMd
- /// YEAR_NUM_MONTH_WEEKDAY_DAY yMEd
- /// YEAR_ABBR_MONTH yMMM
- /// YEAR_ABBR_MONTH_DAY yMMMd
- /// YEAR_ABBR_MONTH_WEEKDAY_DAY yMMMEd
- /// YEAR_MONTH yMMMM
- /// YEAR_MONTH_DAY yMMMMd
- /// YEAR_MONTH_WEEKDAY_DAY yMMMMEEEEd
- /// YEAR_ABBR_QUARTER yQQQ
- /// YEAR_QUARTER yQQQQ
- /// HOUR24 H
- /// HOUR24_MINUTE Hm
- /// HOUR24_MINUTE_SECOND Hms
- /// HOUR j
- /// HOUR_MINUTE jm
- /// HOUR_MINUTE_SECOND jms
- /// HOUR_MINUTE_GENERIC_TZ jmv
- /// HOUR_MINUTE_TZ jmz
- /// HOUR_GENERIC_TZ jv
- /// HOUR_TZ jz
- /// MINUTE m
- /// MINUTE_SECOND ms
- /// SECOND s
+ /// ICU Name Skeleton
+ /// -------- --------
+ /// DAY d
+ /// ABBR_WEEKDAY E
+ /// WEEKDAY EEEE
+ /// ABBR_STANDALONE_MONTH LLL
+ /// STANDALONE_MONTH LLLL
+ /// NUM_MONTH M
+ /// NUM_MONTH_DAY Md
+ /// NUM_MONTH_WEEKDAY_DAY MEd
+ /// ABBR_MONTH MMM
+ /// ABBR_MONTH_DAY MMMd
+ /// ABBR_MONTH_WEEKDAY_DAY MMMEd
+ /// MONTH MMMM
+ /// MONTH_DAY MMMMd
+ /// MONTH_WEEKDAY_DAY MMMMEEEEd
+ /// ABBR_QUARTER QQQ
+ /// QUARTER QQQQ
+ /// YEAR y
+ /// YEAR_NUM_MONTH yM
+ /// YEAR_NUM_MONTH_DAY yMd
+ /// YEAR_NUM_MONTH_WEEKDAY_DAY yMEd
+ /// YEAR_ABBR_MONTH yMMM
+ /// YEAR_ABBR_MONTH_DAY yMMMd
+ /// YEAR_ABBR_MONTH_WEEKDAY_DAY yMMMEd
+ /// YEAR_MONTH yMMMM
+ /// YEAR_MONTH_DAY yMMMMd
+ /// YEAR_MONTH_WEEKDAY_DAY yMMMMEEEEd
+ /// YEAR_ABBR_QUARTER yQQQ
+ /// YEAR_QUARTER yQQQQ
+ /// HOUR24 H
+ /// HOUR24_MINUTE Hm
+ /// HOUR24_MINUTE_SECOND Hms
+ /// HOUR j
+ /// HOUR_MINUTE jm
+ /// HOUR_MINUTE_SECOND jms
+ /// HOUR_MINUTE_GENERIC_TZ jmv
+ /// HOUR_MINUTE_TZ jmz
+ /// HOUR_GENERIC_TZ jv
+ /// HOUR_TZ jz
+ /// MINUTE m
+ /// MINUTE_SECOND ms
+ /// SECOND s
///
/// Defaults to null.
///
/// See also:
- /// [onViewChanged].
- /// [DateFormat].
+ /// * [onViewChanged], to get the current visible dates collection
+ /// * [headerHeight], to customize the size of the header view in calendar.
+ /// * [DateFormat], to know about the different available formats.
+ /// * Knowledge base: [How to change the month header format](https://www.syncfusion.com/kb/12550/how-to-change-the-month-header-format-in-the-flutter-calendar)
+ ///
///
/// ``` dart
/// @override
@@ -665,6 +743,10 @@ class SfCalendar extends StatefulWidget {
/// A builder that builds a widget, replace the schedule month header
/// widget in calendar schedule view.
///
+ /// See also:
+ /// * [scheduleViewSettings], to customize the schedule view of calendar.
+ /// * Knowledge base: [Customize the schedule view month header using builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+ ///
/// ```dart
/// @override
/// Widget build(BuildContext context) {
@@ -694,9 +776,14 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to `7` which indicates `DateTime.sunday`.
///
+ /// See also:
+ /// * [showWeekNumber], to display the week number of the year.
+ /// * Knowledge base: [How to change the first day of week](https://www.syncfusion.com/kb/12222/how-to-change-the-first-day-of-week-in-the-flutter-calendar)
+ ///
+ ///
/// ``` dart
///
- ///Widget build(BuildContext context) {
+ /// Widget build(BuildContext context) {
/// return Container(
/// child: SfCalendar(
/// view: CalendarView.week,
@@ -719,6 +806,10 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to null.
///
+ /// See also:
+ /// * [DateFormat], to know more about the available formats.
+ /// * Knowledge base: [How to format appointment time](https://www.syncfusion.com/kb/11989/how-to-format-the-appointment-time-in-the-flutter-calendar)
+ ///
/// ``` dart
///
///Widget build(BuildContext context) {
@@ -743,6 +834,12 @@ class SfCalendar extends StatefulWidget {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [SfCalendarTheme], to handle theming with calendar for giving consistent
+ /// look.
+ /// * [backgroundColor], which fills the background of the calendar.
+ /// * Knowledge base: [How to customize the cell border](https://www.syncfusion.com/kb/12118/how-to-customize-the-cell-border-in-the-flutter-calendar)
+ ///
/// ``` dart
///
///Widget build(BuildContext context) {
@@ -767,6 +864,17 @@ class SfCalendar extends StatefulWidget {
/// [ScheduleViewSettings.appointmentItemHeight] and
/// [ScheduleViewSettings.hideEmptyScheduleWeek] in schedule view of calendar.
///
+ /// See also:
+ /// * [scheduleViewMonthHeaderBuilder], to customize the schedule view month
+ /// header with a custom widget.
+ /// * [ScheduleViewSettings], to know about the available customization
+ /// options for schedule view.
+ /// * Knowledge base: [How to customize appointment height in schedule view](https://www.syncfusion.com/kb/12226/how-to-customize-the-appointment-height-in-schedule-view-of-the-flutter-calendar)
+ /// * Knowledge base: [How to customize day, week, month header of schedule view](https://www.syncfusion.com/kb/12178/how-to-customize-the-day-week-month-header-of-schedule-view-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize schedule view month header with builder](https://www.syncfusion.com/kb/12064/how-to-customize-the-schedule-view-month-header-using-builder-in-the-flutter-calendar)
+ /// * Knowledge base: [How to view schedule](https://www.syncfusion.com/kb/11803/how-to-view-schedule-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the schedule view](https://www.syncfusion.com/kb/11795/how-to-customize-the-schedule-view-in-the-flutter-calendar)
+ ///
/// ``` dart
///
/// @override
@@ -795,7 +903,14 @@ class SfCalendar extends StatefulWidget {
///
/// 
///
- /// See also: [CalendarHeaderStyle].
+ /// See also:
+ /// * [CalendarHeaderStyle], to know about the available customization options
+ /// for header view.
+ /// * [headerHeight], to customize the size of the header view in calendar.
+ /// * [headerDateFormat], to format the date string in the header view of
+ /// calendar.
+ /// * Knowledge base: [How to style a header](https://www.syncfusion.com/kb/12144/how-to-style-a-header-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add custom header and view header](https://www.syncfusion.com/kb/10997/how-to-add-custom-header-and-view-header-in-the-flutter-calendar)
///
/// ```dart
///Widget build(BuildContext context) {
@@ -820,7 +935,14 @@ class SfCalendar extends StatefulWidget {
///
/// 
///
- /// See also: [ViewHeaderStyle].
+ /// See also:
+ /// * [ViewHeaderStyle], to know about the available customization options for
+ /// view header view in calendar.
+ /// * [viewHeaderHeight], to customize the size of the view header view in
+ /// calendar.
+ /// * Knowledge base: [How to format day and date of view header](https://www.syncfusion.com/kb/12339/how-to-format-the-view-header-day-and-date-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add custom header and view header](https://www.syncfusion.com/kb/10997/how-to-add-custom-header-and-view-header-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight tapped date in view header](https://www.syncfusion.com/kb/12469/how-to-highlight-the-tapped-view-header-in-the-flutter-calendar)
///
/// ```dart
///
@@ -845,6 +967,14 @@ class SfCalendar extends StatefulWidget {
///
/// 
///
+ /// See also:
+ /// * [headerStyle] to know about the available customization options
+ /// for header view.
+ /// * [headerDateFormat], to format the date string in the header view of
+ /// calendar.
+ /// * Knowledge base: [How to style a header](https://www.syncfusion.com/kb/12144/how-to-style-a-header-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add custom header and view header](https://www.syncfusion.com/kb/10997/how-to-add-custom-header-and-view-header-in-the-flutter-calendar)
+ ///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -862,11 +992,19 @@ class SfCalendar extends StatefulWidget {
/// Adds padding at the right end of a cell to interact when the calendar
/// cells have appointments.
///
- /// defaults to '1'.
+ /// defaults to '-1'.
///
- /// Note: This is not applicable for month agenda and schedule view
+ /// _Note:_ This is not applicable for month agenda and schedule view
/// appointments.
///
+ /// See also:
+ /// * [onTap], to get the tapped elements, date and other details, when an
+ /// element tapped in calendar.
+ /// * [onLongPress], to get the tapped elements, date and other details when
+ /// an element long tapped in calendar.
+ /// * [dataSource], to set and handle appointments with calendar.
+ /// * Knowledge base: [How to interact with calendar cell when appointments loaded](https://www.syncfusion.com/kb/12218/how-to-interact-with-event-calendar-cell-when-appointments-loaded-in-the-flutter-calendar)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -891,7 +1029,15 @@ class SfCalendar extends StatefulWidget {
/// of month view, for agenda view appointments styling can be achieved by
/// using the [MonthViewSettings.agendaStyle.appointmentTextStyle].
///
- /// See also: [AgendaStyle].
+ /// See also:
+ /// * [AgendaStyle], to customize the agenda view of month view in calendar.
+ /// * [dataSource], to set and handle the appointments for calendar.
+ /// * [appointmentBuilder], to set an custom widget for the appointment UI.
+ /// * [Appointment], to know more about the appointment and it's properties in
+ /// calendar.
+ /// * [appointmentTimeTextFormat], to customize the time text format in the
+ /// appointment view of calendar.
+ /// * Knowledge base: [How to style appointments](https://www.syncfusion.com/kb/12162/how-to-style-the-appointment-in-the-flutter-calendar)
///
/// ```dart
///
@@ -917,6 +1063,13 @@ class SfCalendar extends StatefulWidget {
///
/// 
///
+ /// See also:
+ /// * [viewHeaderStyle], to know about the available customization options for
+ /// view header view in calendar.
+ /// * Knowledge base: [How to format day and date of view header](https://www.syncfusion.com/kb/12339/how-to-format-the-view-header-day-and-date-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add custom header and view header](https://www.syncfusion.com/kb/10997/how-to-add-custom-header-and-view-header-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight tapped date in view header](https://www.syncfusion.com/kb/12469/how-to-highlight-the-tapped-view-header-in-the-flutter-calendar)
+ ///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -942,9 +1095,17 @@ class SfCalendar extends StatefulWidget {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [showCurrentTimeIndicator], to display an indicator in the current time
+ /// of the day in calendar.
+ /// * [todayTextStyle], to customize the today text in calendar.
+ /// * [SfCalendarTheme], to handle theming with calendar for giving consistent
+ /// look.
+ /// * Knowledge base: [How to customize the current day color](https://www.syncfusion.com/kb/12336/how-to-customize-the-current-day-color-in-the-flutter-calendar)
+ ///
/// ```dart
///
- ///Widget build(BuildContext context) {
+ /// Widget build(BuildContext context) {
/// return Container(
/// child: SfCalendar(
/// view: CalendarView.week,
@@ -973,10 +1134,15 @@ class SfCalendar extends StatefulWidget {
/// appearance of various components of the calendar.
///
/// See also:
- /// [ViewHeaderStyle],
- /// [ScheduleViewSettings],
- /// [MonthViewSettings],
- /// To know more about the view header customization refer here [https://help.syncfusion.com/flutter/calendar/headers#view-header]
+ /// * [todayHighlightColor], to customize the highlighting color of the today
+ /// cell in calendar.
+ /// * [ViewHeaderStyle], to know about the available customization options for
+ /// view header view in calendar.
+ /// * [ScheduleViewSettings], to know about the available customization
+ /// options for schedule view in calendar.
+ /// * [MonthViewSettings], to know about the available customization options
+ /// for month vie win calendar.
+ /// * To know more about the view header customization refer here [https://help.syncfusion.com/flutter/calendar/headers#view-header]
///
/// ```dart
///Widget build(BuildContext context) {
@@ -999,6 +1165,12 @@ class SfCalendar extends StatefulWidget {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [cellBorderColor], will fill the cell border of the calendar.
+ /// * [SfCalendarTheme], to handle theming with calendar for giving consistent
+ /// look.
+ /// * Knowledge base: [How to add an image as background](https://www.syncfusion.com/kb/12243/how-to-add-an-image-as-background-in-the-flutter-calendar)
+ ///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -1024,6 +1196,14 @@ class SfCalendar extends StatefulWidget {
/// _Note:_ Header view does not show arrow when calendar view as
/// [CalendarView.schedule]
///
+ /// See also:
+ /// * [CalendarController.forward], to navigate to next view of calendar
+ /// programmatically with animation.
+ /// * [CalendarController.backward], to navigate to previous view of calendar
+ /// programmatically with animation.
+ /// * Knowledge base: [How to navigate to the previous or next view using navigation arrows](https://www.syncfusion.com/kb/12247/how-to-navigate-to-the-previous-or-next-views-using-navigation-arrows-in-the-flutter)
+ ///
+ ///
/// ``` dart
///Widget build(BuildContext context) {
/// return Container(
@@ -1037,15 +1217,23 @@ class SfCalendar extends StatefulWidget {
/// ```
final bool showNavigationArrow;
- /// Specifies the view navigation for [SfCalendar] ] to
- /// show dates for the next or previous views.
-
+ /// Specifies the view navigation for [SfCalendar] to show dates for the next
+ /// or previous views.
+ ///
/// Defaults to ViewNavigationMode.snap.
-
+ ///
/// Not applicable when the [view] set as [CalendarView.schedule].
- /// It will not impact scrolling timeslot views,
- /// [controller.forward], [controller.backward]
- /// and [showNavigationArrow].
+ /// It will not impact scrolling timeslot views, [controller.forward],
+ /// [controller.backward] and [showNavigationArrow].
+ ///
+ /// See also:
+ /// * [minDate], to restrict the navigation and interaction to the dates
+ /// before to this date in calendar.
+ /// * [maxDate], to restrict the navigation and interaction to the dates after
+ /// to this date in calendar.
+ /// * [showNavigationArrow], to enable the navigation arrow, which enables to
+ /// navigate to the next/previous view of calendar programmatically.
+ /// * Knowledge base: [How to restrict view navigation](https://www.syncfusion.com/kb/12554/how-to-restrict-the-view-navigation-in-the-flutter-calendar)
///
/// ``` dart
///Widget build(BuildContext context) {
@@ -1072,6 +1260,22 @@ class SfCalendar extends StatefulWidget {
/// [TimeSlotViewSettings.dayFormat], and [TimeSlotViewSettings.timeRulerSize]
/// in time slot views of calendar.
///
+ /// See also:
+ /// * [monthViewSettings], to know more about the customization options for
+ /// the month view of calendar.
+ /// * [TimeSlotViewSettings], to know more about the customization options for
+ /// the month view of calendar.
+ /// * [scheduleViewSettings], to know more about the customization options for
+ /// the schedule view of calendar.
+ /// * [specialRegions], which allows to customize particular time region in
+ /// the time slot views of calendar.
+ /// * Knowledge base: [How to customize time label](https://www.syncfusion.com/kb/11008/how-to-customize-the-time-label-in-the-flutter-calendar)
+ /// * Knowledge base: [How to change the time interval width and height](https://www.syncfusion.com/kb/12322/how-to-change-the-time-interval-width-and-height-in-the-flutter-event-calendar-sfcalendar)
+ /// * Knowledge base: [How to set the arbitrary height to an appointment](https://www.syncfusion.com/kb/12279/how-to-set-the-arbitrary-height-to-appointments-in-the-flutter-calendar)
+ /// * Knowledge base: [How to auto fit the calendar to screen height](https://www.syncfusion.com/kb/12231/how-to-autofit-the-calendar-to-screen-height-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the timeline appointment height](https://www.syncfusion.com/kb/12147/how-to-customize-the-timeline-appointment-height-in-the-flutter-calendar)
+ /// * Knowledge base: [How to change working days and hours](https://www.syncfusion.com/kb/12146/how-to-change-the-working-days-and-hours-in-the-flutter-calendar)
+ ///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -1103,10 +1307,15 @@ class SfCalendar extends StatefulWidget {
/// views.
///
/// See also:
- ///
- /// * [CalendarResource], the resource data for calendar.
+ /// * [CalendarResource], the object which contains the data for the resource
+ /// in calendar.
/// * [dataSource.resources], the collection of resource to be displayed in
/// the timeline views of [SfCalendar].
+ /// * [ResourceViewSettings], which contains options to customize the
+ /// resource view of calendar.
+ /// * [resourceViewHeaderBuilder], to set custom widget for the resource
+ /// header in the calendar.
+ /// * Knowledge base: [How to customize the resource view](https://www.syncfusion.com/kb/12351/how-to-customize-the-resource-view-in-the-flutter-calendar)
///
/// ```dart
///@override
@@ -1168,6 +1377,24 @@ class SfCalendar extends StatefulWidget {
/// [MonthViewSettings.appointmentDisplayCount], and
/// [MonthViewSettings.navigationDirection] in month view of calendar.
///
+ /// See also:
+ /// * [monthCellBuilder], to customize the month cell with custom widget in
+ /// calendar.
+ /// * [MonthViewSettings], to know more about the customization of month view
+ /// in calendar.
+ /// * [blackoutDates], which allows to restrict the interaction for a
+ /// particular date in month views of calendar.
+ /// * [blackoutDatesTextStyle], which used to customize the blackout dates
+ /// text style in the month view of calendar.
+ /// * Knowledge base: [How to customize agenda view height based on widget height](https://www.syncfusion.com/kb/11013/how-to-customize-agenda-view-height-based-on-the-flutter-calendar-widget-height)
+ /// * Knowledge base: [How to customize agenda item height](https://www.syncfusion.com/kb/11015/how-to-customize-the-agenda-item-height-in-the-flutter-calendar)
+ /// * Knowledge base: [How to show appointment in agenda view using programmatic date selection](https://www.syncfusion.com/kb/11525/how-to-show-the-appointment-in-agenda-view-using-the-programmatic-date-selection-in-the)
+ /// * Knowledge base: [How to customize the blackout dates](https://www.syncfusion.com/kb/11987/how-to-customize-the-blackout-dates-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the leading and trailing dates](https://www.syncfusion.com/kb/11988/how-to-customize-the-leading-and-trailing-dates-of-the-month-cells-in-the-flutter-calendar)
+ /// * Knowledge base: [How to style the month cell](https://www.syncfusion.com/kb/12090/how-to-style-the-month-cell-in-the-flutter-calendar)
+ /// * Knowledge base: [How to change the number of weeks](https://www.syncfusion.com/kb/12157/how-to-change-the-number-of-weeks-in-the-flutter-calendar)
+ /// * Knowledge base: [How to customize the agenda view appointment](https://www.syncfusion.com/kb/12271/how-to-customize-the-agenda-view-appointment-using-the-style-properties-in-flutter-calendar)
+ ///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -1197,6 +1424,13 @@ class SfCalendar extends StatefulWidget {
/// Styling of the blackout dates can be handled using the
/// [blackoutDatesTextStyle] property in [SfCalendar].
///
+ /// See also:
+ /// *[blackoutDatesTextStyle], to customize the blackout dates text in
+ /// calendar.
+ /// * Knowledge base: (How to update blackout dates using onViewChanged)[https://www.syncfusion.com/kb/12368/how-to-update-blackout-dates-using-onviewchanged-callback-in-the-flutter-calendar]
+ /// * Knowledge base: (How to add active dates)[https://www.syncfusion.com/kb/12073/how-to-add-active-dates-in-the-flutter-calendar]
+ /// * Knowledge base: (How to customize the blackout dates )[https://www.syncfusion.com/kb/12003/how-to-customize-the-blackout-dates-in-the-flutter-event-calendar-sfcalendar]
+ ///
/// ```dart
///
/// Widget build(BuildContext context) {
@@ -1229,7 +1463,14 @@ class SfCalendar extends StatefulWidget {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
- /// See also: [blackoutDates].
+ /// See also:
+ /// * [blackoutDates], which will add blackout dates to the calendar.
+ /// * [SfCalendarTheme], to handle theming with calendar for giving consistent
+ /// look.
+ /// * Knowledge base: (How to update blackout dates using onViewChanged)[https://www.syncfusion.com/kb/12368/how-to-update-blackout-dates-using-onviewchanged-callback-in-the-flutter-calendar]
+ /// * Knowledge base: (How to add active dates)[https://www.syncfusion.com/kb/12073/how-to-add-active-dates-in-the-flutter-calendar]
+ /// * Knowledge base: (How to customize the blackout dates )[https://www.syncfusion.com/kb/12003/how-to-customize-the-blackout-dates-in-the-flutter-event-calendar-sfcalendar]
+ ///
///
/// ``` dart
///
@@ -1259,6 +1500,14 @@ class SfCalendar extends StatefulWidget {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
+ /// See also:
+ /// * [initialSelectedDate], to select date when calendar displays initially
+ /// * [CalendarController.selectedDate], to select date programmatically in
+ /// calendar in the runtime.
+ /// * [SfCalendarTheme], to handle theming with calendar for giving consistent
+ /// look.
+ /// * Knowledge base: [How to customize the selection using decoration](https://www.syncfusion.com/kb/12245/how-to-customize-the-selection-using-decoration-in-the-flutter-calendar)
+ ///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -1288,6 +1537,20 @@ class SfCalendar extends StatefulWidget {
/// Defaults to `DateTime(DateTime.now().year, DateTime.now().month,
/// DateTime.now().day, 08, 45, 0)`.
///
+ /// See also:
+ /// * [CalendarController.displayDate], to change the display date of calendar
+ /// programmatically on run time.
+ /// * [CalendarController.forward], to navigate to next view of calendar
+ /// programmatically.
+ /// * [CalendarController.backward], to navigate to previous view of calendar
+ /// Programmatically.
+ /// * [onViewChanged], the callback which will notify that the current visible
+ /// dates were changed in calendar.
+ /// * [initialSelectedDate], to selected date programmatically on calendar
+ /// initially.
+ /// * Knowledge base: [How to programmatically navigate to adjacent dates](https://www.syncfusion.com/kb/12654/how-to-programmatically-navigate-to-the-adjacent-dates-in-the-flutter-calendar)
+ /// * Knowledge base: [How to programmatically navigate to a date](https://www.syncfusion.com/kb/12139/how-to-programmatically-navigate-to-the-date-in-the-flutter-event-calendar-sfcalendar)
+ ///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -1316,8 +1579,13 @@ class SfCalendar extends StatefulWidget {
/// Defaults to null.
///
/// See also:
- /// [Appointment.startTimeZone].
- /// [Appointment.endTimeZone].
+ /// * [Appointment.startTimeZone], to handle time zone for appointment's start
+ /// time.
+ /// * [Appointment.endTimeZone], to handle time zone for appointment's end
+ /// time.
+ /// * [The documentation for time zone](https://help.syncfusion.com/flutter/calendar/timezone)
+ ///
+ ///
///
/// ```dart
///
@@ -1339,6 +1607,20 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to null.
///
+ /// See also:
+ /// * [CalendarController.selectedDate], to selected date programmatically on
+ /// calendar in the runtime.
+ /// * [selectionDecoration], to add decoration for the selected cell in
+ /// calendar.
+ /// * [initialDisplayDate], to navigate to the given date on calendar
+ /// initially.
+ /// * [CalendarController.displayDate], to navigate to the given date on
+ /// calendar programmatically in runtime.
+ /// * [onSelectionChanged], the callback which notifies when the selected cell
+ /// changed on calendar.
+ /// * Knowledge base: [How to get the selected dates using selection changed callback](https://www.syncfusion.com/kb/12551/how-to-get-the-selected-dates-using-selection-changed-callback-in-the-flutter-calendar)
+ /// * Knowledge base: [How to programmatically select the dates](https://www.syncfusion.com/kb/12115/how-to-programmatically-select-the-dates-in-the-flutter-calendar)
+ ///
/// ```dart
///
///Widget build(BuildContext context) {
@@ -1368,7 +1650,19 @@ class SfCalendar extends StatefulWidget {
/// available
/// in the [ViewChangedDetails].
///
- /// See also: [ViewChangedDetails].
+ /// See also:
+ /// * [ViewChangedDetails], which contains the visible dates collection of the
+ /// current visible view.
+ /// * [initialDisplayDate], to display calendar on a desired date in initial.
+ /// * [CalendarController.displayDate], to change the display date of calendar
+ /// programmatically on run time.
+ /// * [CalendarController.forward], to navigate to next view of calendar
+ /// programmatically.
+ /// * [CalendarController.backward], to navigate to previous view of calendar
+ /// Programmatically.
+ /// * Knowledge base: [How to update blackout dates using onViewChanged](https://www.syncfusion.com/kb/12368/how-to-update-blackout-dates-using-onviewchanged-callback-in-the-flutter-calendar)
+ /// * Knowledge base: [How to clear the appointments in the month agenda view using onViewChange](https://www.syncfusion.com/kb/12089/how-to-clear-the-appointments-in-month-agenda-view-using-onviewchange-callback-in-the)
+ /// * Knowledge base: [How to add a special region dynamically using onTap, onViewChanged](https://www.syncfusion.com/kb/11729/how-to-add-a-special-region-dynamically-using-ontap-onviewchanged-callbacks-of-the-flutter)
///
/// ```dart
///
@@ -1392,8 +1686,23 @@ class SfCalendar extends StatefulWidget {
/// performed on element available in the [CalendarTapDetails].
///
/// see also:
- /// [CalendarTapDetails].
- /// [CalendarElement]
+ /// * [CalendarTapDetails], which contains the details of the tapped element
+ /// in the calendar.
+ /// * [CalendarElement], to know about the different available elements in the
+ /// calendar.
+ /// * [initialSelectedDate], to selected the date programmatically on calendar
+ /// initially.
+ /// * [CalendarController.selectedDate], to selected date programmatically on
+ /// calendar in the runtime.
+ /// * [selectionDecoration], to add decoration for the selected cell in
+ /// calendar.
+ /// * [onSelectionChanged], the callback which notifies when the selected cell
+ /// changed on calendar.
+ /// * Knowledge base: [How to get appointment details for the onTap](https://www.syncfusion.com/kb/10999/how-to-get-appointment-details-from-the-ontap-event-of-the-flutter-calendar)
+ /// * Knowledge base: [How to add a special region dynamically using onTap, onViewChanged](https://www.syncfusion.com/kb/11729/how-to-add-a-special-region-dynamically-using-ontap-onviewchanged-callbacks-of-the-flutter)
+ /// * Knowledge base: [How to interact with event calendar with appointments loaded](https://www.syncfusion.com/kb/12218/how-to-interact-with-event-calendar-cell-when-appointments-loaded-in-the-flutter-calendar)
+ /// * Knowledge base: [How to add the appointments using the onTap](https://www.syncfusion.com/kb/12300/how-to-add-the-appointments-using-the-ontap-callback-in-the-flutter-calendar)
+ /// * Knowledge base: [How to design and configure your appointment editor](https://www.syncfusion.com/kb/11204/how-to-design-and-configure-your-appointment-editor-in-flutter-calendar)
///
/// ```dart
///
@@ -1419,8 +1728,15 @@ class SfCalendar extends StatefulWidget {
/// performed on element available in the [CalendarLongPressDetails].
///
/// see also:
- /// [CalendarLongPressDetails].
- /// [CalendarElement]
+ /// * [CalendarLongPressDetails], which contains the details of the long
+ /// pressed element in the calendar.
+ /// * [CalendarElement], to know about the different available elements in the
+ /// calendar.
+ /// * [selectionDecoration], to add decoration for the selected cell in
+ /// calendar.
+ /// * [onSelectionChanged], the callback which notifies when the selected cell
+ /// changed on calendar.
+ /// * Knowledge base: [How to handle the long press action](https://www.syncfusion.com/kb/12121/how-to-handle-the-long-press-action-on-date-selection-in-the-flutter-calendar)
///
/// ```dart
///
@@ -1445,7 +1761,19 @@ class SfCalendar extends StatefulWidget {
/// its resource details.
///
/// see also:
- /// [initialSelectedDate], and [controller.selectedDate].
+ /// * [CalendarSelectionDetails], which contains the details of the selected
+ /// element in the calendar.
+ /// * [CalendarElement], to know about the different available elements in the
+ /// calendar.
+ /// * [initialSelectedDate], to selected the date programmatically on calendar
+ /// initially.
+ /// * [CalendarController.selectedDate], to selected date programmatically on
+ /// calendar in the runtime.
+ /// * [selectionDecoration], to add decoration for the selected cell in
+ /// calendar.
+ /// * [onTap], the callback which notifies when the calendar elements tapped
+ /// on view.
+ /// * Knowledge base: [How to get the selected dates using the selection changed](https://www.syncfusion.com/kb/12551/how-to-get-the-selected-dates-using-selection-changed-callback-in-the-flutter-calendar)
///
/// ```dart
///
@@ -1472,7 +1800,34 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to null.
///
- /// see also: [CalendarDataSource]
+ /// see also:
+ /// * [CalendarDataSource], to add and handle the appointments and resource on
+ /// the calendar.
+ /// * [Appointment], the object which holds the details of the appointment.
+ /// * [CalendarResource], the object which holds the details of the resource
+ /// in the calendar.
+ /// * [loadMoreWidgetBuilder], allows to build an widget which will display
+ /// when appointments loaded on demand in the calendar.
+ /// * [resourceViewHeaderBuilder], to set custom widget for the resource view
+ /// in the calendar.
+ /// * [resourceViewSettings], to customize the resource view in the calendar.
+ /// * [appointmentBuilder], to set custom widget for the appointment view in
+ /// the calendar.
+ /// * [appointmentTextStyle], to customize the text style for the appointments
+ /// in calendar.
+ /// * [appointmentTimeTextFormat], to customize the time format for the
+ /// appointment view in calendar.
+ /// * Knowledge base: [How to perform the crud operations using firestore database](https://www.syncfusion.com/kb/12661/how-to-perform-the-crud-operations-in-flutter-calendar-using-firestore-database)
+ /// * Knowledge base: [How to load appointments on demand](https://www.syncfusion.com/kb/12658/how-to-load-appointments-on-demand-in-flutter-calendar)
+ /// * Knowledge base: [How to load google calendar events in iOS](https://www.syncfusion.com/kb/12647/how-to-load-the-google-calendar-events-to-the-flutter-calendar-sfcalendar-in-ios)
+ /// * Knowledge base: [How to get the appointments between the given start and end date](https://www.syncfusion.com/kb/12549/how-to-get-the-appointments-between-the-given-start-and-end-date-in-the-flutter-calendar)
+ /// * Knowledge base: [How to get the current month appointments](https://www.syncfusion.com/kb/12477/how-to-get-the-current-month-appointments-in-the-flutter-calendar)
+ /// * Knowledge base: [How to load data from offline sqlite database](https://www.syncfusion.com/kb/12399/how-to-load-data-from-offline-sqlite-database-to-flutter-calendar)
+ /// * Knowledge base: [How to create time table](https://www.syncfusion.com/kb/12392/how-to-create-time-table-using-flutter-event-calendar)
+ /// * Knowledge base: [How to add google calendar events](https://www.syncfusion.com/kb/12116/how-to-add-google-calendar-events-to-the-flutter-event-calendar-sfcalendar)
+ /// * Knowledge base: [How to add a custom appointments of business objects](https://www.syncfusion.com/kb/11529/how-to-add-a-custom-appointments-or-objects-in-the-flutter-calendar)
+ /// * Knowledge base: [How to delete an appointment](https://www.syncfusion.com/kb/11522/how-to-delete-an-appointment-in-the-flutter-calendar)
+ ///
///
/// ```dart
///
@@ -1523,6 +1878,18 @@ class SfCalendar extends StatefulWidget {
///
/// It also used to restrict interaction on time slots.
///
+ /// See also:
+ /// * [timeRegionBuilder], to set custom widget for the time regions in the
+ /// calendar
+ /// * [TimeRegion], to now the details about the special time regions and it's
+ /// properties in calendar.
+ /// * Knowledge base: [How to customize special regions with builder](https://www.syncfusion.com/kb/12192/how-to-customize-the-special-time-region-using-custom-builder-in-the-flutter-calendar)
+ /// * Knowledge base: [How to create time table](https://www.syncfusion.com/kb/12392/how-to-create-time-table-using-flutter-event-calendar)
+ /// * Knowledge base: [How to add a special region dynamically using onTap and onViewChanged](https://www.syncfusion.com/kb/11729/how-to-add-a-special-region-dynamically-using-ontap-onviewchanged-callbacks-of-the-flutter)
+ /// * Knowledge base: [How to use multiple recurrence rule in special region](https://www.syncfusion.com/kb/11730/how-to-use-multiple-recurrence-rule-rrule-in-special-region-using-flutter-calendar)
+ /// * Knowledge base: [How to highlight the weekends](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+ /// * Knowledge base: [How to highlight the lunch hours](https://www.syncfusion.com/kb/11712/how-to-highlight-the-weekends-in-the-flutter-calendar)
+ ///
/// ``` dart
/// Widget build(BuildContext context) {
/// return Container(
@@ -1557,7 +1924,10 @@ class SfCalendar extends StatefulWidget {
///
/// Defaults to false
///
- /// see also: [weekNumberStyle]
+ /// see also:
+ /// * [weekNumberStyle], to customize the week number view in the calendar.
+ /// * [firstDayOfWeek], to change the first day of the week in the calendar.
+ ///
///
/// ``` dart
/// Widget build(BuildContext context) {
@@ -1576,9 +1946,14 @@ class SfCalendar extends StatefulWidget {
/// Using a [SfCalendarTheme] gives more fine-grained control over the
/// appearance of various components of the calendar.
///
- /// Defaults to null
+ /// Defaults to false
///
- /// see also: [showWeekNumber]
+ /// see also:
+ /// * [showWeekNumber], to display the week number view on the calendar views.
+ /// * [WeekNumberStyle], to know more about the available customization
+ /// options for week number view in calendar.
+ /// * [SfCalendarTheme], to handle theming with calendar for giving consistent
+ /// look.
///
/// ``` dart
/// Widget build(BuildContext context) {
@@ -1600,8 +1975,11 @@ class SfCalendar extends StatefulWidget {
/// Defaults to null.
///
/// see also:
- /// [ResourceViewSettings].
- /// [CalendarResource]
+ /// * [resourceViewSettings], to customize the resource view in the calendar
+ /// * [CalendarResource], the object which holds the data of the resource in
+ /// calendar.
+ /// * [dataSource.resources], the collection of resource to be displayed in
+ /// the timeline views of [SfCalendar].
///
/// ``` dart
/// Widget build(BuildContext context) {
@@ -1638,6 +2016,153 @@ class SfCalendar extends StatefulWidget {
/// }
final ResourceViewHeaderBuilder? resourceViewHeaderBuilder;
+ /// Allows to drag and drop the appointment, to reschedule this into
+ /// new date time.
+ ///
+ /// Defaults to false.
+ ///
+ /// See also:
+ /// * [allowAppointmentResize], which allows to resize the appointment to
+ /// reschedule.
+ /// * [dragAndDropSettings], which allows to customize the drag and
+ /// drop environment.
+ ///
+ /// _Note:_ This doesn't applicable when the [view] set as
+ /// [CalendarView.schedule]. This doesn't applicable when the [view] set as
+ /// [CalendarView.month] and [CalendarView.timelineMonth] in mobile layout.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// ),
+ /// );
+ /// }
+ final bool allowDragAndDrop;
+
+ /// Allows to customize the drag and drop environment.
+ ///
+ /// See also:
+ /// * [monthViewSettings], which allows to customize the month view of
+ /// the calendar.
+ /// * [timeSlotViewSettings], which allows to customize the timeslot view
+ /// of the calendar.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// ),
+ /// );
+ /// }
+ final DragAndDropSettings dragAndDropSettings;
+
+ /// Called whenever the appointment starts to drag in the [SfCalendar].
+ ///
+ /// The callback arguments contains the dragging appointment and associated
+ /// resource details.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// onDragStart: (AppointmentDragStartDetails details) {
+ /// dynamic appointment = details.appointment!;
+ /// CalendarResource? resource = details.resource;
+ /// }),
+ /// );
+ /// }
+ final AppointmentDragStartCallback? onDragStart;
+
+ /// Called whenever the appointment is dragging in the [SfCalendar].
+ ///
+ /// The callback arguments contains the dragging appointment, dragging time,
+ /// dragging offset, source resource and target resource details.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// onDragUpdate: (AppointmentDragUpdateDetails details) {
+ /// dynamic appointment = details.appointment!;
+ /// CalendarResource? sourceResource = details.sourceResource;
+ /// CalendarResource? targetResource = details.targetResource;
+ /// Offset? draggingPosition = details.draggingPosition;
+ /// DateTime? draggingTime = details.draggingTime;
+ /// }),
+ /// );
+ /// }
+ final AppointmentDragUpdateCallback? onDragUpdate;
+
+ /// Called when the dragging appointment is dropped in the [SfCalendar].
+ ///
+ /// The callback arguments contains the dropped appointment, dropping time,
+ /// source and target resource details.
+ ///
+ /// ``` dart
+ /// Widget build(BuildContext context) {
+ /// return Scaffold(
+ /// body: SfCalendar(
+ /// view: CalendarView.month,
+ /// showWeekNumber: true,
+ /// allowDragAndDrop: true,
+ /// dragAndDropSettings: DragAndDropSettings(
+ /// allowNavigation: true,
+ /// allowScroll: true,
+ /// autoNavigateDelay: Duration(seconds: 1),
+ /// indicatorTimeFormat: 'HH:mm a',
+ /// showTimeIndicator: true,
+ /// ),
+ /// onDragEnd: (AppointmentDragEndDetails details) {
+ /// dynamic appointment = details.appointment!;
+ /// CalendarResource? sourceResource = details.sourceResource;
+ /// CalendarResource? targetResource = details.targetResource;
+ /// DateTime? draggingTime = details.droppingTime;
+ /// }),
+ /// );
+ /// }
+ final AppointmentDragEndCallback? onDragEnd;
+
/// An object that used for programmatic date navigation and date selection
/// in [SfCalendar].
///
@@ -1665,10 +2190,24 @@ class SfCalendar extends StatefulWidget {
/// controller, the listener will listen and notify whenever the selected
/// date, display date changed in the [SfCalendar].
///
- /// See also: [CalendarController].
- ///
/// Defaults to null.
///
+ /// See also:
+ /// * [CalendarController], to know more about the controller and it's usage
+ /// with the calendar.
+ /// * [initialSelectedDate], to select dates initially on the calendar.
+ /// * [initialDisplayDate], the date which shown when the calendar displayed
+ /// initially.
+ /// * [onViewChanged], the callback which notifies when the current view
+ /// visible date changed on calendar.
+ /// * [onSelectionChanged], the callback which notifies when the selected cell
+ /// changed on the calendar.
+ /// * Knowledge base: [How to programmatically navigate to adjacent days](https://www.syncfusion.com/kb/12654/how-to-programmatically-navigate-to-the-adjacent-dates-in-the-flutter-calendar)
+ /// * Knowledge base: [How to do programmatic navigation](https://www.syncfusion.com/kb/12141/how-to-do-programmatic-navigation-using-flutter-calendar)
+ /// * Knowledge base: [How to programmatically select the dates](https://www.syncfusion.com/kb/12115/how-to-programmatically-select-the-dates-in-the-flutter-calendar)
+ /// * Knowledge base: [How to move to a specific time while switching view](https://www.syncfusion.com/kb/10943/how-to-move-to-a-specific-time-while-switching-from-month-to-day-view-in-the-flutter)
+ ///
+ ///
/// This example demonstrates how to use the [CalendarController] for
/// [SfCalendar].
///
@@ -1700,6 +2239,122 @@ class SfCalendar extends StatefulWidget {
/// ```
final CalendarController? controller;
+ /// Allows to reschedule the appointment by resizing the appointment.
+ ///
+ /// Defaults to `false`.
+ ///
+ /// _Note:_ The appointment resizing is not applicable for mobile platform.
+ ///
+ /// See also:
+ /// • [allowDragAndDrop], which allows to reschedule a appointment by drag
+ /// and drop to different date time.
+ ///
+ /// ```dart
+ ///
+ /// Widget build(BuildContext context) {
+ /// return Container(
+ /// child: SfCalendar(
+ /// allowAppointmentResize: true,
+ /// ),
+ /// );
+ /// }
+ ///
+ /// ````
+ final bool allowAppointmentResize;
+
+ /// Called whenever the appointment starts to resizing in [SfCalendar].
+ ///
+ /// The resizing appointment and resource details when the appointment starts
+ /// to resize available in the [AppointmentResizeStartDetails].
+ ///
+ /// See also:
+ /// * [AppointmentResizeStartDetails], which contains the details of the
+ /// resizing appointment in the calendar.
+ /// * [onAppointmentResizeUpdate], callback to notifies when the appointment
+ /// resizing.
+ /// * [onAppointmentResizeEnd], callback to notify when the appointment
+ /// resizing ends.
+ ///
+ /// ```dart
+ ///
+ /// return Container(
+ /// child: SfCalendar(
+ /// view: CalendarView.week,
+ /// onAppointmentResizeStart: (AppointmentResizeStartDetails details){
+ /// dynamic appointment = details.appointment!;
+ /// CalendarResource? resource = details.resource;
+ /// },
+ /// ),
+ /// );
+ /// }
+ ///
+ /// ```
+ final AppointmentResizeStartCallback? onAppointmentResizeStart;
+
+ /// Called whenever the appointment resizing in [SfCalendar].
+ ///
+ /// The resizing appointment, position, time and resource details when the
+ /// appointment resizing available in the [AppointmentResizeUpdateDetails].
+ ///
+ /// See also:
+ /// * [AppointmentResizeUpdateDetails], which contains the details of the
+ /// resizing appointment details in the calendar.
+ /// * [onAppointmentResizeStart], callback to notifies when the appointment
+ /// start resizing.
+ /// * [onAppointmentResizeEnd], callback to notify when the appointment
+ /// resizing ends.
+ ///
+ /// ```dart
+ ///
+ /// return Container(
+ /// child: SfCalendar(
+ /// view: CalendarView.week,
+ /// onAppointmentResizeUpdate: (AppointmentResizeUpdateDetails
+ /// details){
+ /// dynamic appointment = details.appointment!;
+ /// CalendarResource? resource = details.resource;
+ /// DateTime time = details.resizingTime!;
+ /// Offset position = details.resizingOffset!;
+ /// },
+ /// ),
+ /// );
+ /// }
+ ///
+ /// ```
+ final AppointmentResizeUpdateCallback? onAppointmentResizeUpdate;
+
+ /// Called whenever the appointment resizing end in the [SfCalendar].
+ ///
+ /// The resizing appointment, start time, end time and resource details when
+ /// the appointment resizing ends available in the
+ /// [AppointmentResizeEndDetails].
+ ///
+ /// See also:
+ /// * [AppointmentResizeEndDetails], which contains the details of the
+ /// resized appointment details in the calendar.
+ /// * [onAppointmentResizeStart], callback to notifies when the appointment
+ /// start resizing.
+ /// * [onAppointmentResizeUpdate], callback to notifies when the appointment
+ /// resizing.
+ ///
+ /// ```dart
+ ///
+ /// return Container(
+ /// child: SfCalendar(
+ /// view: CalendarView.week,
+ /// onAppointmentResizeEnd: (AppointmentResizeEndDetails details){
+ /// dynamic appointment = details.appointment!;
+ /// CalendarResource? resource = details.resource;
+ /// DateTime time = details.startTime!;
+ /// DateTime endTime = details.endTime!;
+ /// },
+ /// ),
+ /// );
+ /// }
+ ///
+ /// ```
+ final AppointmentResizeEndCallback? onAppointmentResizeEnd;
+
/// Returns the date time collection at which the recurrence appointment will
/// recur
///
@@ -1717,6 +2372,13 @@ class SfCalendar extends StatefulWidget {
///
/// return `List`
///
+ /// See also:
+ /// * [Appointment.recurrenceRule], to set the recurrence rule for the
+ /// [Appointment], which will recur based on the given rule.
+ /// * [TimeRegion.recurrenceRule], to set the recurrence rule for the
+ /// [TimeRegion], which will recur based on the given rule.
+ /// * Knowledge base: [How to get the recurrence date collection](https://www.syncfusion.com/kb/12344/how-to-get-the-recurrence-date-collection-in-the-flutter-calendar)
+ ///
///```dart
///
/// DateTime dateTime = DateTime(2020, 03, 15);
@@ -1752,6 +2414,14 @@ class SfCalendar extends StatefulWidget {
///
/// returns `RecurrenceProperties`.
///
+ /// See also:
+ /// * [RecurrenceProperties], to know more about the available recurrence
+ /// properties which helps to create the recurrence rule.
+ /// * [generateRRule], to generate recurrence rule based on the
+ /// [RecurrenceProperties].
+ /// * Knowledge base: [How to get the recurrence properties from rrule](https://www.syncfusion.com/kb/12370/how-to-get-the-recurrence-properties-from-rrule-in-the-flutter-calendar)
+ ///
+ ///
/// ```dart
///
/// DateTime dateTime = DateTime(2020, 03, 15);
@@ -1775,6 +2445,16 @@ class SfCalendar extends StatefulWidget {
///
/// returns `String`.
///
+ /// See also:
+ /// * [RecurrenceProperties], to know more about the available recurrence
+ /// properties which helps to create the recurrence rule.
+ /// * [parseRRule], to generate the recurrence properties based on the
+ /// recurrence rule.
+ /// * [Appointment.recurrenceRule], to set the recurrence rule for the
+ /// [Appointment], which will recur based on the given rule.
+ /// * [TimeRegion.recurrenceRule], to set the recurrence rule for the
+ /// [TimeRegion], which will recur based on the given rule.
+ ///
/// ```dart
///
/// RecurrenceProperties recurrenceProperties =
@@ -1884,6 +2564,16 @@ class SfCalendar extends StatefulWidget {
.toDiagnosticsNode(name: 'specialRegions'));
properties.add(DiagnosticsProperty(
'resourceViewHeaderBuilder', resourceViewHeaderBuilder));
+ properties
+ .add(DiagnosticsProperty('allowDragAndDrop', allowDragAndDrop));
+ properties.add(
+ dragAndDropSettings.toDiagnosticsNode(name: 'dragAndDropSettings'));
+ properties.add(DiagnosticsProperty(
+ 'onDragStart', onDragStart));
+ properties.add(DiagnosticsProperty(
+ 'onDragUpdate', onDragUpdate));
+ properties.add(DiagnosticsProperty(
+ 'onDragEnd', onDragEnd));
}
}
@@ -1899,7 +2589,8 @@ class _SfCalendarState extends State
/// Used to get the scrolled position to update the header value.
ScrollController? _agendaScrollController, _resourcePanelScrollController;
- late ValueNotifier _agendaSelectedDate;
+ late ValueNotifier _agendaSelectedDate,
+ _timelineMonthWeekNumberNotifier;
ValueNotifier _headerUpdateNotifier =
ValueNotifier(null);
late String _locale;
@@ -2047,6 +2738,8 @@ class _SfCalendarState extends State
_scheduleDisplayDate = _controller.displayDate!;
_controller.view ??= widget.view;
_view = _controller.view!;
+ _timelineMonthWeekNumberNotifier =
+ ValueNotifier(_controller.displayDate);
if (_selectedDate != null) {
_updateSelectionChangedCallback();
}
@@ -2093,10 +2786,14 @@ class _SfCalendarState extends State
final SfCalendarThemeData calendarThemeData = SfCalendarTheme.of(context);
final ThemeData themeData = Theme.of(context);
_calendarTheme = calendarThemeData.copyWith(
- todayHighlightColor:
- calendarThemeData.todayHighlightColor ?? themeData.accentColor,
- selectionBorderColor:
- calendarThemeData.selectionBorderColor ?? themeData.accentColor);
+ todayHighlightColor: calendarThemeData.todayHighlightColor ??
+ themeData.colorScheme.secondary,
+ selectionBorderColor: calendarThemeData.selectionBorderColor ??
+ themeData.colorScheme.secondary,
+ timeIndicatorTextStyle: calendarThemeData.timeIndicatorTextStyle
+ .copyWith(
+ color: calendarThemeData.timeIndicatorTextStyle.color ??
+ themeData.colorScheme.secondary));
//// localeOf(context) returns the locale from material app when SfCalendar locale value as null
_locale = Localizations.localeOf(context).toString();
_localizations = SfLocalizations.of(context);
@@ -2843,6 +3540,9 @@ class _SfCalendarState extends State
if (_view == CalendarView.timelineMonth) {
_currentViewVisibleDates =
DateTimeHelper.getCurrentMonthDates(_currentViewVisibleDates);
+ if (widget.showWeekNumber) {
+ _timelineMonthWeekNumberNotifier.value = _currentViewVisibleDates[0];
+ }
}
}
@@ -3221,8 +3921,8 @@ class _SfCalendarState extends State[];
for (final CalendarAppointment appointment in _visibleAppointments) {
if (appointment.isAllDay ||
- appointment.actualEndTime
- .difference(appointment.actualStartTime)
+ AppointmentHelper.getDifference(
+ appointment.actualStartTime, appointment.actualEndTime)
.inDays >
0) {
allDayAppointments.add(appointment);
@@ -3239,10 +3939,10 @@ class _SfCalendarState extends State
_allDayAppointmentViewCollection
.sort((AppointmentView app1, AppointmentView app2) {
if (app1.appointment != null && app2.appointment != null) {
- return (app2.appointment!.endTime
- .difference(app2.appointment!.startTime)) >
- (app1.appointment!.endTime
- .difference(app1.appointment!.startTime))
+ return AppointmentHelper.getDifference(
+ app2.appointment!.startTime, app2.appointment!.endTime) >
+ AppointmentHelper.getDifference(
+ app1.appointment!.startTime, app1.appointment!.endTime)
? 1
: 0;
}
@@ -3551,6 +4251,8 @@ class _SfCalendarState extends State
}
}
+ final Duration duration = AppointmentHelper.getDifference(
+ appointment.actualStartTime, appointment.actualEndTime);
for (int k = recursiveDates.length - 1; k >= 0; k--) {
final DateTime recurrenceDate = recursiveDates[k];
bool isExceptionDate = false;
@@ -3568,10 +4270,7 @@ class _SfCalendarState extends State
if (!isExceptionDate) {
final DateTime recurrenceEndDate = DateTimeHelper.getDateTimeValue(
- addDuration(
- recurrenceDate,
- appointment.actualEndTime
- .difference(appointment.actualStartTime)));
+ addDuration(recurrenceDate, duration));
if (recurrenceEndDate.isAfter(currentMaxDate)) {
currentMaxDate = recurrenceEndDate;
break;
@@ -3676,8 +4375,8 @@ class _SfCalendarState extends State
final List recursiveDates =
RecurrenceHelper.getRecurrenceDateTimeCollection(
rule, appointment.actualStartTime,
- recurrenceDuration: appointment.actualEndTime
- .difference(appointment.actualStartTime),
+ recurrenceDuration: AppointmentHelper.getDifference(
+ appointment.actualStartTime, appointment.actualEndTime),
specificStartDate: startDate,
specificEndDate: endDate);
@@ -4383,7 +5082,8 @@ class _SfCalendarState extends State
_isMobilePlatform,
widget.appointmentBuilder,
_minWidth - viewPadding,
- panelHeight),
+ panelHeight,
+ widget),
)),
onTapUp: (TapUpDetails details) {
_removeDatePicker();
@@ -4804,7 +5504,8 @@ class _SfCalendarState extends State
DateTime(currentDate.year, currentDate.month, currentDate.day),
widget.dataSource != null &&
!AppointmentHelper.isCalendarAppointment(widget.dataSource!)
- ? CalendarViewHelper.getCustomAppointments(currentAppointments)
+ ? CalendarViewHelper.getCustomAppointments(
+ currentAppointments, widget.dataSource)
: currentAppointments,
CalendarElement.viewHeader,
null);
@@ -4814,7 +5515,8 @@ class _SfCalendarState extends State
DateTime(currentDate.year, currentDate.month, currentDate.day),
widget.dataSource != null &&
!AppointmentHelper.isCalendarAppointment(widget.dataSource!)
- ? CalendarViewHelper.getCustomAppointments(currentAppointments)
+ ? CalendarViewHelper.getCustomAppointments(
+ currentAppointments, widget.dataSource)
: currentAppointments,
CalendarElement.viewHeader,
null);
@@ -4866,7 +5568,7 @@ class _SfCalendarState extends State
!AppointmentHelper.isCalendarAppointment(
widget.dataSource!)
? CalendarViewHelper.getCustomAppointments(
- selectedAppointment)
+ selectedAppointment, widget.dataSource)
: selectedAppointment,
CalendarElement.appointment,
null);
@@ -4878,7 +5580,7 @@ class _SfCalendarState extends State
!AppointmentHelper.isCalendarAppointment(
widget.dataSource!)
? CalendarViewHelper.getCustomAppointments(
- selectedAppointment)
+ selectedAppointment, widget.dataSource)
: selectedAppointment,
CalendarElement.appointment,
null);
@@ -5297,39 +5999,41 @@ class _SfCalendarState extends State
color: widget.headerStyle.backgroundColor ??
_calendarTheme.headerBackgroundColor,
child: _CalendarHeaderView(
- _currentViewVisibleDates,
- widget.headerStyle,
- null,
- _view,
- widget.monthViewSettings.numberOfWeeksInView,
- _calendarTheme,
- isRTL,
- _locale,
- widget.showNavigationArrow,
- _controller,
- widget.maxDate,
- widget.minDate,
- _minWidth,
- widget.headerHeight,
- widget.timeSlotViewSettings.nonWorkingDays,
- widget.monthViewSettings.navigationDirection,
- widget.showDatePickerButton,
- _showHeader,
- widget.allowedViews,
- widget.allowViewNavigation,
- _localizations,
- _removeDatePicker,
- _headerUpdateNotifier,
- _viewChangeNotifier,
- _handleOnTapForHeader,
- _handleOnLongPressForHeader,
- widget.todayHighlightColor,
- _textScaleFactor,
- _isMobilePlatform,
- widget.headerDateFormat,
- true,
- widget.todayTextStyle,
- )),
+ _currentViewVisibleDates,
+ widget.headerStyle,
+ null,
+ _view,
+ widget.monthViewSettings.numberOfWeeksInView,
+ _calendarTheme,
+ isRTL,
+ _locale,
+ widget.showNavigationArrow,
+ _controller,
+ widget.maxDate,
+ widget.minDate,
+ _minWidth,
+ widget.headerHeight,
+ widget.timeSlotViewSettings.nonWorkingDays,
+ widget.monthViewSettings.navigationDirection,
+ widget.showDatePickerButton,
+ _showHeader,
+ widget.allowedViews,
+ widget.allowViewNavigation,
+ _localizations,
+ _removeDatePicker,
+ _headerUpdateNotifier,
+ _viewChangeNotifier,
+ _handleOnTapForHeader,
+ _handleOnLongPressForHeader,
+ widget.todayHighlightColor,
+ _textScaleFactor,
+ _isMobilePlatform,
+ widget.headerDateFormat,
+ true,
+ widget.todayTextStyle,
+ widget.showWeekNumber,
+ widget.weekNumberStyle,
+ _timelineMonthWeekNumberNotifier)),
),
),
Positioned(
@@ -6144,39 +6848,41 @@ class _SfCalendarState extends State
color: widget.headerStyle.backgroundColor ??
_calendarTheme.headerBackgroundColor,
child: _CalendarHeaderView(
- _currentViewVisibleDates,
- widget.headerStyle,
- null,
- _view,
- widget.monthViewSettings.numberOfWeeksInView,
- _calendarTheme,
- isRTL,
- _locale,
- widget.showNavigationArrow,
- _controller,
- widget.maxDate,
- widget.minDate,
- _minWidth,
- widget.headerHeight,
- widget.timeSlotViewSettings.nonWorkingDays,
- widget.monthViewSettings.navigationDirection,
- widget.showDatePickerButton,
- _showHeader,
- widget.allowedViews,
- widget.allowViewNavigation,
- _localizations,
- _removeDatePicker,
- _headerUpdateNotifier,
- _viewChangeNotifier,
- _handleOnTapForHeader,
- _handleOnLongPressForHeader,
- widget.todayHighlightColor,
- _textScaleFactor,
- _isMobilePlatform,
- widget.headerDateFormat,
- !_isScheduleStartLoadMore && !_isNeedLoadMore,
- widget.todayTextStyle,
- )),
+ _currentViewVisibleDates,
+ widget.headerStyle,
+ null,
+ _view,
+ widget.monthViewSettings.numberOfWeeksInView,
+ _calendarTheme,
+ isRTL,
+ _locale,
+ widget.showNavigationArrow,
+ _controller,
+ widget.maxDate,
+ widget.minDate,
+ _minWidth,
+ widget.headerHeight,
+ widget.timeSlotViewSettings.nonWorkingDays,
+ widget.monthViewSettings.navigationDirection,
+ widget.showDatePickerButton,
+ _showHeader,
+ widget.allowedViews,
+ widget.allowViewNavigation,
+ _localizations,
+ _removeDatePicker,
+ _headerUpdateNotifier,
+ _viewChangeNotifier,
+ _handleOnTapForHeader,
+ _handleOnLongPressForHeader,
+ widget.todayHighlightColor,
+ _textScaleFactor,
+ _isMobilePlatform,
+ widget.headerDateFormat,
+ !_isScheduleStartLoadMore && !_isNeedLoadMore,
+ widget.todayTextStyle,
+ widget.showWeekNumber,
+ widget.weekNumberStyle,
+ _timelineMonthWeekNumberNotifier)),
),
),
Positioned(
@@ -6708,8 +7414,8 @@ class _SfCalendarState extends State
if (app.resourceIds != null &&
app.resourceIds!.isNotEmpty &&
app.resourceIds!.contains(resource.id)) {
- selectedResourceAppointments
- .add(CalendarViewHelper.getAppointmentDetail(app));
+ selectedResourceAppointments.add(
+ CalendarViewHelper.getAppointmentDetail(app, widget.dataSource));
}
}
@@ -6762,6 +7468,7 @@ class _SfCalendarState extends State
widget.minDate,
widget.maxDate,
_localizations,
+ _timelineMonthWeekNumberNotifier,
_updateCalendarState,
_getCalendarStateDetails,
key: _customScrollViewKey,
@@ -6788,39 +7495,41 @@ class _SfCalendarState extends State
color: widget.headerStyle.backgroundColor ??
_calendarTheme.headerBackgroundColor,
child: _CalendarHeaderView(
- _currentViewVisibleDates,
- widget.headerStyle,
- currentViewDate,
- _view,
- widget.monthViewSettings.numberOfWeeksInView,
- _calendarTheme,
- isRTL,
- _locale,
- widget.showNavigationArrow,
- _controller,
- widget.maxDate,
- widget.minDate,
- width,
- widget.headerHeight,
- widget.timeSlotViewSettings.nonWorkingDays,
- widget.monthViewSettings.navigationDirection,
- widget.showDatePickerButton,
- _showHeader,
- widget.allowedViews,
- widget.allowViewNavigation,
- _localizations,
- _removeDatePicker,
- _headerUpdateNotifier,
- _viewChangeNotifier,
- _handleOnTapForHeader,
- _handleOnLongPressForHeader,
- widget.todayHighlightColor,
- _textScaleFactor,
- _isMobilePlatform,
- widget.headerDateFormat,
- !_isNeedLoadMore,
- widget.todayTextStyle,
- )),
+ _currentViewVisibleDates,
+ widget.headerStyle,
+ currentViewDate,
+ _view,
+ widget.monthViewSettings.numberOfWeeksInView,
+ _calendarTheme,
+ isRTL,
+ _locale,
+ widget.showNavigationArrow,
+ _controller,
+ widget.maxDate,
+ widget.minDate,
+ width,
+ widget.headerHeight,
+ widget.timeSlotViewSettings.nonWorkingDays,
+ widget.monthViewSettings.navigationDirection,
+ widget.showDatePickerButton,
+ _showHeader,
+ widget.allowedViews,
+ widget.allowViewNavigation,
+ _localizations,
+ _removeDatePicker,
+ _headerUpdateNotifier,
+ _viewChangeNotifier,
+ _handleOnTapForHeader,
+ _handleOnLongPressForHeader,
+ widget.todayHighlightColor,
+ _textScaleFactor,
+ _isMobilePlatform,
+ widget.headerDateFormat,
+ !_isNeedLoadMore,
+ widget.todayTextStyle,
+ widget.showWeekNumber,
+ widget.weekNumberStyle,
+ _timelineMonthWeekNumberNotifier)),
),
_addResourcePanel(isResourceEnabled, resourceViewSize, height, isRTL),
_addCustomScrollView(widget.headerHeight, resourceViewSize, isRTL,
@@ -7235,6 +7944,10 @@ class _SfCalendarState extends State
(CalendarAppointment app1, CalendarAppointment app2) =>
AppointmentHelper.orderAppointmentsAscending(
app1.isAllDay, app2.isAllDay));
+ agendaAppointments.sort(
+ (CalendarAppointment app1, CalendarAppointment app2) =>
+ AppointmentHelper.orderAppointmentsAscending(
+ app1.isSpanned, app2.isSpanned));
int index = -1;
//// Agenda appointment view top padding as 5.
@@ -7271,7 +7984,8 @@ class _SfCalendarState extends State
agendaAppointments = [agendaAppointments[index]];
if (widget.dataSource != null &&
!AppointmentHelper.isCalendarAppointment(widget.dataSource!)) {
- return CalendarViewHelper.getCustomAppointments(agendaAppointments);
+ return CalendarViewHelper.getCustomAppointments(
+ agendaAppointments, widget.dataSource);
}
return agendaAppointments;
@@ -7330,7 +8044,8 @@ class _SfCalendarState extends State
_isMobilePlatform,
widget.appointmentBuilder,
width,
- height),
+ height,
+ widget),
onTapUp: (TapUpDetails details) {
_handleTapForAgenda(details, null);
},
@@ -7440,7 +8155,8 @@ class _SfCalendarState extends State
_isMobilePlatform,
widget.appointmentBuilder,
width - _agendaDateViewWidth,
- painterHeight),
+ painterHeight,
+ widget),
],
),
),
@@ -7586,11 +8302,15 @@ class _CalendarHeaderView extends StatefulWidget {
this.isMobilePlatform,
this.headerDateFormat,
this.enableInteraction,
- this.todayTextStyle);
+ this.todayTextStyle,
+ this.showWeekNumber,
+ this.weekNumberStyle,
+ this.timelineMonthWeekNumberNotifier);
final List visibleDates;
final TextStyle? todayTextStyle;
final CalendarHeaderStyle headerStyle;
+ final WeekNumberStyle weekNumberStyle;
final SfCalendarThemeData calendarTheme;
final DateTime? currentDate;
final CalendarView view;
@@ -7620,6 +8340,8 @@ class _CalendarHeaderView extends StatefulWidget {
final bool isMobilePlatform;
final String? headerDateFormat;
final bool enableInteraction;
+ final bool showWeekNumber;
+ final ValueNotifier timelineMonthWeekNumberNotifier;
@override
_CalendarHeaderViewState createState() => _CalendarHeaderViewState();
@@ -7631,7 +8353,9 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
@override
void initState() {
widget.valueChangeNotifier.addListener(_updateHeaderChanged);
- _calendarViews = _getCalendarViewsText(widget.localizations);
+ widget.timelineMonthWeekNumberNotifier
+ .addListener(_updateWeekNumberChangedForTimelineMonth);
+ _calendarViews = _getCalendarViewsText(widget.localizations, true);
super.initState();
}
@@ -7642,7 +8366,15 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
widget.valueChangeNotifier.addListener(_updateHeaderChanged);
}
- _calendarViews = _getCalendarViewsText(widget.localizations);
+ if (widget.timelineMonthWeekNumberNotifier !=
+ oldWidget.timelineMonthWeekNumberNotifier) {
+ oldWidget.timelineMonthWeekNumberNotifier
+ .removeListener(_updateWeekNumberChangedForTimelineMonth);
+ widget.timelineMonthWeekNumberNotifier
+ .addListener(_updateWeekNumberChangedForTimelineMonth);
+ }
+
+ _calendarViews = _getCalendarViewsText(widget.localizations, true);
super.didUpdateWidget(oldWidget);
}
@@ -7668,6 +8400,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
}
final String headerString = _getHeaderText();
+ final String weekNumberString = _getWeekNumberString();
final double totalArrowWidth = arrowWidth * 2;
/// Show calendar views on header when it is not empty.
@@ -7675,6 +8408,8 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
widget.allowedViews != null && widget.allowedViews!.isNotEmpty;
double todayIconWidth = 0;
double dividerWidth = 0;
+ double weekNumberPanelWidth = 0, weekNumberPanelHeight = 0;
+ double weekNumberTextWidth = 0;
final List children = [];
Color? headerTextColor = widget.headerStyle.textStyle != null
? widget.headerStyle.textStyle!.color
@@ -7712,7 +8447,18 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
}
double headerTextWidth = 0;
- if (!widget.isMobilePlatform) {
+ final bool isTimelineView = CalendarViewHelper.isTimelineView(widget.view);
+ final TextStyle weekNumberTextStyle = widget.weekNumberStyle.textStyle ??
+ widget.calendarTheme.weekNumberTextStyle;
+
+ final Color? weekNumberBackgroundColor =
+ widget.weekNumberStyle.backgroundColor ??
+ widget.calendarTheme.weekNumberBackgroundColor;
+
+ final bool weekNumberEnabled = widget.showWeekNumber &&
+ (widget.view == CalendarView.day || isTimelineView);
+ if (!widget.isMobilePlatform ||
+ (widget.isMobilePlatform && weekNumberEnabled)) {
final Size headerTextSize = _getTextWidgetWidth(
headerString,
widget.height,
@@ -7847,15 +8593,48 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
}
}
+ final double headerHeight =
+ maxHeaderHeight != 0 && maxHeaderHeight <= widget.height
+ ? maxHeaderHeight
+ : widget.height;
+
headerWidth = widget.width -
calendarViewWidth -
todayIconWidth -
dividerWidth -
totalArrowWidth;
- final double headerHeight =
- maxHeaderHeight != 0 && maxHeaderHeight <= widget.height
- ? maxHeaderHeight
- : widget.height;
+
+ if (weekNumberEnabled) {
+ weekNumberPanelWidth = (headerWidth - headerTextWidth) + padding;
+ final double minimumWeekNumberWidth = headerWidth / 4;
+ if (weekNumberPanelWidth < minimumWeekNumberWidth) {
+ weekNumberPanelWidth = minimumWeekNumberWidth + padding;
+ headerWidth = headerTextWidth - weekNumberPanelWidth;
+ } else {
+ headerWidth = headerTextWidth;
+ }
+ final Size weekNumberPanelSize = _getTextWidgetWidth(
+ widget.localizations.weeknumberLabel + weekNumberString + ' ',
+ headerHeight,
+ weekNumberPanelWidth,
+ context,
+ style: weekNumberTextStyle);
+ weekNumberTextWidth = weekNumberPanelSize.width > weekNumberPanelWidth
+ ? weekNumberPanelWidth
+ : weekNumberPanelSize.width + padding;
+ weekNumberPanelHeight = weekNumberPanelSize.height;
+ final double occupiedWidth = widget.width -
+ calendarViewWidth -
+ todayIconWidth -
+ dividerWidth -
+ totalArrowWidth -
+ weekNumberPanelWidth -
+ headerWidth;
+ if (occupiedWidth < 0) {
+ headerWidth += occupiedWidth;
+ }
+ }
+
final List dates = widget.visibleDates;
if (!DateTimeHelper.canMoveToNextView(
widget.view,
@@ -7956,34 +8735,33 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
alignment: Alignment.centerLeft,
padding: const EdgeInsets.symmetric(horizontal: 5),
child: Row(
- mainAxisAlignment: _getAlignmentFromTextAlign(),
- children: widget.showDatePickerButton
- ? [
- Flexible(
- child: Text(headerString,
- style: headerTextStyle,
- maxLines: 1,
- overflow: TextOverflow.clip,
- softWrap: false,
- textDirection: TextDirection.ltr)),
- Icon(
- widget.isPickerShown
- ? Icons.arrow_drop_up
- : Icons.arrow_drop_down,
- color: arrowColor,
- size: headerTextStyle.fontSize ?? 14,
- )
- ]
- : [
- Flexible(
- child: Text(headerString,
- style: headerTextStyle,
- maxLines: 1,
- overflow: TextOverflow.clip,
- softWrap: false,
- textDirection: TextDirection.ltr))
- ],
- )),
+ mainAxisAlignment: _getAlignmentFromTextAlign(),
+ children: widget.showDatePickerButton
+ ? [
+ Flexible(
+ child: Text(headerString,
+ style: headerTextStyle,
+ maxLines: 1,
+ overflow: TextOverflow.clip,
+ softWrap: false,
+ textDirection: TextDirection.ltr)),
+ Icon(
+ widget.isPickerShown
+ ? Icons.arrow_drop_up
+ : Icons.arrow_drop_down,
+ color: arrowColor,
+ size: headerTextStyle.fontSize ?? 14,
+ ),
+ ]
+ : [
+ Flexible(
+ child: Text(headerString,
+ style: headerTextStyle,
+ maxLines: 1,
+ overflow: TextOverflow.clip,
+ softWrap: false,
+ textDirection: TextDirection.ltr))
+ ])),
),
)),
)
@@ -8045,7 +8823,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
: Icons.arrow_drop_down,
color: arrowColor,
size: headerTextStyle.fontSize ?? 14,
- )
+ ),
]
: [
Flexible(
@@ -8054,13 +8832,57 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
maxLines: 1,
overflow: TextOverflow.clip,
softWrap: false,
- textDirection: TextDirection.ltr))
+ textDirection: TextDirection.ltr)),
],
)),
),
)),
);
+ final Widget weekNumberWidget = weekNumberEnabled
+ ? Semantics(
+ label:
+ widget.localizations.weeknumberLabel + ' ' + weekNumberString,
+ child: Container(
+ width: isCenterAlignment
+ ? weekNumberTextWidth
+ : weekNumberPanelWidth,
+ height: weekNumberPanelHeight,
+ alignment: _getHeaderAlignment(),
+ child: Container(
+ decoration: BoxDecoration(
+ borderRadius:
+ const BorderRadius.all(Radius.circular(padding)),
+ shape: BoxShape.rectangle,
+ color: weekNumberBackgroundColor),
+ alignment: Alignment.center,
+ width: weekNumberTextWidth,
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Flexible(
+ child: Text(
+ widget.localizations.weeknumberLabel,
+ textAlign: TextAlign.center,
+ textScaleFactor: widget.textScaleFactor,
+ style: weekNumberTextStyle,
+ overflow: TextOverflow.ellipsis,
+ maxLines: 1,
+ )),
+ Flexible(
+ child: Text(
+ ' ' + weekNumberString,
+ textAlign: TextAlign.center,
+ style: weekNumberTextStyle,
+ textScaleFactor: widget.textScaleFactor,
+ maxLines: 1,
+ ))
+ ],
+ )),
+ ),
+ )
+ : Container();
+
final Color? leftArrowSplashColor =
prevArrowColor != arrowColor || !widget.enableInteraction
? Colors.transparent
@@ -8204,11 +9026,13 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
);
List rowChildren = [];
+
if (widget.headerStyle.textAlign == TextAlign.left ||
widget.headerStyle.textAlign == TextAlign.start) {
if (widget.isMobilePlatform) {
rowChildren = [
headerText,
+ weekNumberWidget,
todayIcon,
calendarViewIcon,
leftArrow,
@@ -8219,6 +9043,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
leftArrow,
rightArrow,
headerText,
+ weekNumberWidget,
todayIcon,
dividerWidget,
];
@@ -8239,6 +9064,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
rightArrow,
calendarViewIcon,
todayIcon,
+ weekNumberWidget,
headerText,
];
} else {
@@ -8248,6 +9074,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
rowChildren.add(dividerWidget);
rowChildren.add(todayIcon);
+ rowChildren.add(weekNumberWidget);
rowChildren.add(headerText);
rowChildren.add(leftArrow);
rowChildren.add(rightArrow);
@@ -8262,6 +9089,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
rowChildren = [
leftArrow,
headerText,
+ weekNumberWidget,
todayIcon,
dividerWidget,
calendarViewIcon,
@@ -8271,6 +9099,7 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
rowChildren = [
leftArrow,
headerText,
+ weekNumberWidget,
rightArrow,
todayIcon,
dividerWidget,
@@ -8290,6 +9119,8 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
@override
void dispose() {
widget.valueChangeNotifier.removeListener(_updateHeaderChanged);
+ widget.valueChangeNotifier
+ .removeListener(_updateWeekNumberChangedForTimelineMonth);
super.dispose();
}
@@ -8297,6 +9128,14 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
setState(() {});
}
+ void _updateWeekNumberChangedForTimelineMonth() {
+ if (!mounted) {
+ return;
+ }
+
+ setState(() {});
+ }
+
void _backward() {
if (!widget.enableInteraction) {
return;
@@ -8416,6 +9255,51 @@ class _CalendarHeaderViewState extends State<_CalendarHeaderView> {
);
}
+ String _getWeekNumberString() {
+ switch (widget.view) {
+ case CalendarView.day:
+ case CalendarView.timelineDay:
+ {
+ return DateTimeHelper.getWeekNumberOfYear(widget.visibleDates[0])
+ .toString();
+ }
+ case CalendarView.week:
+ case CalendarView.workWeek:
+ case CalendarView.month:
+ case CalendarView.schedule:
+ return '';
+ case CalendarView.timelineWeek:
+ for (int i = 0; i < widget.visibleDates.length; i++) {
+ final DateTime date = widget.visibleDates[i];
+ if (date.weekday == DateTime.monday) {
+ return DateTimeHelper.getWeekNumberOfYear(date).toString();
+ }
+ }
+ break;
+ case CalendarView.timelineWorkWeek:
+ for (int i = 0; i < widget.visibleDates.length; i++) {
+ final DateTime date = widget.visibleDates[i];
+ if (date.weekday == DateTime.monday) {
+ return DateTimeHelper.getWeekNumberOfYear(date).toString();
+ } else if (widget.nonWorkingDays.contains(DateTime.monday)) {
+ final int midDate = widget.visibleDates.length ~/ 2;
+ return DateTimeHelper.getWeekNumberOfYear(
+ widget.visibleDates[midDate])
+ .toString();
+ }
+ }
+ break;
+ case CalendarView.timelineMonth:
+ {
+ return DateTimeHelper.getWeekNumberOfYear(
+ widget.timelineMonthWeekNumberNotifier.value!)
+ .toString();
+ }
+ }
+ return DateTimeHelper.getWeekNumberOfYear(widget.visibleDates[0])
+ .toString();
+ }
+
String _getHeaderText() {
String monthFormat = 'MMMM';
final String? headerDateFormat =
@@ -8563,6 +9447,8 @@ class _ScheduleLabelPainter extends CustomPainter {
@override
void paint(Canvas canvas, Size size) {
+ canvas.clipRect(Rect.fromLTWH(0, 0, size.width, size.height));
+
/// Draw the week label.
if (!isMonthLabel) {
if (isDisplayDate) {
@@ -8781,6 +9667,7 @@ class _ScheduleLabelPainter extends CustomPainter {
accessibilityText =
DateFormat('MMMM yyyy', locale).format(startDate).toString();
}
+
semanticsBuilder.add(CustomPainterSemantics(
rect: Rect.fromLTWH(left, top, size.width, cellHeight),
properties: SemanticsProperties(
@@ -9566,21 +10453,62 @@ Size _getTextWidgetWidth(
return Size(textWidth + 10, textHeight + 10);
}
-Map _getCalendarViewsText(SfLocalizations localizations) {
+Map _getCalendarViewsText(SfLocalizations localizations,
+ [bool isUpperCase = false]) {
final Map calendarViews = {};
- calendarViews[CalendarView.day] = localizations.allowedViewDayLabel;
- calendarViews[CalendarView.week] = localizations.allowedViewWeekLabel;
- calendarViews[CalendarView.workWeek] = localizations.allowedViewWorkWeekLabel;
+ calendarViews[CalendarView.day] = localizations.allowedViewDayLabel.isNotEmpty
+ ? localizations.allowedViewDayLabel
+ : isUpperCase
+ ? 'DAY'
+ : 'Day';
+ calendarViews[CalendarView.week] =
+ localizations.allowedViewWeekLabel.isNotEmpty
+ ? localizations.allowedViewWeekLabel
+ : isUpperCase
+ ? 'WEEK'
+ : 'Week';
+ calendarViews[CalendarView.workWeek] =
+ localizations.allowedViewWorkWeekLabel.isNotEmpty
+ ? localizations.allowedViewWorkWeekLabel
+ : isUpperCase
+ ? 'WORK WEEK'
+ : 'Work Week';
calendarViews[CalendarView.timelineDay] =
- localizations.allowedViewTimelineDayLabel;
+ localizations.allowedViewTimelineDayLabel.isNotEmpty
+ ? localizations.allowedViewTimelineDayLabel
+ : isUpperCase
+ ? 'TIMELINE DAY'
+ : 'Timeline Day';
calendarViews[CalendarView.timelineWeek] =
- localizations.allowedViewTimelineWeekLabel;
+ localizations.allowedViewTimelineWeekLabel.isNotEmpty
+ ? localizations.allowedViewTimelineWeekLabel
+ : isUpperCase
+ ? 'TIMELINE WEEK'
+ : 'Timeline Week';
calendarViews[CalendarView.timelineMonth] =
- localizations.allowedViewTimelineMonthLabel;
+ localizations.allowedViewTimelineMonthLabel.isNotEmpty
+ ? localizations.allowedViewTimelineMonthLabel
+ : isUpperCase
+ ? 'TIMELINE MONTH'
+ : 'Timeline Month';
calendarViews[CalendarView.timelineWorkWeek] =
- localizations.allowedViewTimelineWorkWeekLabel;
- calendarViews[CalendarView.month] = localizations.allowedViewMonthLabel;
- calendarViews[CalendarView.schedule] = localizations.allowedViewScheduleLabel;
+ localizations.allowedViewTimelineWorkWeekLabel.isNotEmpty
+ ? localizations.allowedViewTimelineWorkWeekLabel
+ : isUpperCase
+ ? 'TIMELINE WORK WEEK'
+ : 'Timeline Work Week';
+ calendarViews[CalendarView.month] =
+ localizations.allowedViewMonthLabel.isNotEmpty
+ ? localizations.allowedViewMonthLabel
+ : isUpperCase
+ ? 'MONTH'
+ : 'Month';
+ calendarViews[CalendarView.schedule] =
+ localizations.allowedViewScheduleLabel.isNotEmpty
+ ? localizations.allowedViewScheduleLabel
+ : isUpperCase
+ ? 'SCHEDULE'
+ : 'Schedule';
return calendarViews;
}
diff --git a/packages/syncfusion_flutter_calendar/lib/src/calendar/views/calendar_view.dart b/packages/syncfusion_flutter_calendar/lib/src/calendar/views/calendar_view.dart
index e8b6e534a..698f1c8af 100644
--- a/packages/syncfusion_flutter_calendar/lib/src/calendar/views/calendar_view.dart
+++ b/packages/syncfusion_flutter_calendar/lib/src/calendar/views/calendar_view.dart
@@ -12,6 +12,8 @@ import 'package:syncfusion_flutter_core/core_internal.dart';
import 'package:syncfusion_flutter_core/localizations.dart';
import 'package:syncfusion_flutter_core/theme.dart';
+import '../../../calendar.dart';
+import '../appointment_engine/appointment.dart';
import '../appointment_engine/appointment_helper.dart';
import '../appointment_engine/recurrence_helper.dart';
import '../appointment_layout/allday_appointment_layout.dart';
@@ -21,6 +23,7 @@ import '../common/calendar_view_helper.dart';
import '../common/date_time_engine.dart';
import '../common/enums.dart';
import '../resource_view/calendar_resource.dart';
+import '../settings/drag_and_drop_settings.dart';
import '../settings/month_view_settings.dart';
import '../settings/time_region.dart';
import '../settings/time_slot_view_settings.dart';
@@ -62,6 +65,7 @@ class CustomCalendarScrollView extends StatefulWidget {
this.minDate,
this.maxDate,
this.localizations,
+ this.timelineMonthWeekNumberNotifier,
this.updateCalendarState,
this.getCalendarState,
{Key? key})
@@ -104,6 +108,10 @@ class CustomCalendarScrollView extends StatefulWidget {
/// selection and it set to null on month appointment selection.
final ValueNotifier agendaSelectedDate;
+ /// Notifier to update the weeknumber of timeline month view based on scroll
+ /// changed.
+ final ValueNotifier timelineMonthWeekNumberNotifier;
+
/// Holds the special time region of calendar widget.
final List? specialRegions;
@@ -245,8 +253,14 @@ class _CustomCalendarScrollViewState extends State
final FocusScopeNode _focusNode = FocusScopeNode();
+ late ValueNotifier<_DragPaintDetails> _dragDetails;
+ Offset? _dragDifferenceOffset;
+ Timer? _timer;
+
@override
void initState() {
+ _dragDetails = ValueNotifier<_DragPaintDetails>(
+ _DragPaintDetails(position: ValueNotifier(null)));
widget.controller.forward = widget.isRTL
? _moveToPreviousViewWithAnimation
: _moveToNextViewWithAnimation;
@@ -434,6 +448,12 @@ class _CustomCalendarScrollViewState extends State
_updateCalendarStateDetails.currentDate =
widget.controller.displayDate!;
widget.updateCalendarState(_updateCalendarStateDetails);
+ if (widget.calendar.showWeekNumber &&
+ widget.view == CalendarView.timelineMonth) {
+ widget.timelineMonthWeekNumberNotifier.value =
+ widget.controller.displayDate!;
+ }
+
_updateVisibleDates();
_updateMoveToDate();
_position = 0;
@@ -481,6 +501,36 @@ class _CustomCalendarScrollViewState extends State
}
final bool isTimelineView = CalendarViewHelper.isTimelineView(widget.view);
+ final bool isNeedDragAndDrop = widget.calendar.allowDragAndDrop &&
+ widget.view != CalendarView.schedule &&
+ (!widget.isMobilePlatform ||
+ (widget.view != CalendarView.month &&
+ widget.view != CalendarView.timelineMonth));
+ final double viewHeaderHeight = widget.view == CalendarView.day
+ ? 0
+ : CalendarViewHelper.getViewHeaderHeight(
+ widget.calendar.viewHeaderHeight, widget.view);
+ final double timeLabelWidth = CalendarViewHelper.getTimeLabelWidth(
+ widget.calendar.timeSlotViewSettings.timeRulerSize, widget.view);
+ final bool isResourceEnabled = CalendarViewHelper.isResourceEnabled(
+ widget.calendar.dataSource, widget.view);
+ final double resourceItemHeight = isResourceEnabled
+ ? CalendarViewHelper.getResourceItemHeight(
+ widget.calendar.resourceViewSettings.size,
+ widget.height - viewHeaderHeight - timeLabelWidth,
+ widget.calendar.resourceViewSettings,
+ widget.calendar.dataSource!.resources!.length)
+ : 0;
+ final double resourceViewSize =
+ isResourceEnabled ? widget.calendar.resourceViewSettings.size : 0;
+ final bool isMonthView = widget.view == CalendarView.month ||
+ widget.view == CalendarView.timelineMonth;
+ final double weekNumberPanelWidth =
+ CalendarViewHelper.getWeekNumberPanelWidth(
+ widget.calendar.showWeekNumber,
+ widget.width,
+ widget.isMobilePlatform);
+
final Widget customScrollWidget = GestureDetector(
child: CustomScrollViewerLayout(
_addViews(),
@@ -494,47 +544,203 @@ class _CustomCalendarScrollViewState extends State
_focusNode.requestFocus();
}
},
- onHorizontalDragStart: isTimelineView ? null : _onHorizontalStart,
- onHorizontalDragUpdate: isTimelineView ? null : _onHorizontalUpdate,
- onHorizontalDragEnd: isTimelineView ? null : _onHorizontalEnd,
- onVerticalDragStart: isHorizontalNavigation ? null : _onVerticalStart,
- onVerticalDragUpdate: isHorizontalNavigation ? null : _onVerticalUpdate,
- onVerticalDragEnd: isHorizontalNavigation ? null : _onVerticalEnd,
+ onHorizontalDragStart: isTimelineView
+ ? null
+ : (DragStartDetails dragStartDetails) {
+ _onHorizontalStart(
+ dragStartDetails,
+ isResourceEnabled,
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ isNeedDragAndDrop);
+ },
+ onHorizontalDragUpdate: isTimelineView
+ ? null
+ : (DragUpdateDetails dragUpdateDetails) {
+ _onHorizontalUpdate(
+ dragUpdateDetails,
+ isResourceEnabled,
+ isMonthView,
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ resourceItemHeight,
+ weekNumberPanelWidth,
+ isNeedDragAndDrop);
+ },
+ onHorizontalDragEnd: isTimelineView
+ ? null
+ : (DragEndDetails dragEndDetails) {
+ _onHorizontalEnd(
+ dragEndDetails,
+ isResourceEnabled,
+ isTimelineView,
+ isMonthView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ weekNumberPanelWidth,
+ isNeedDragAndDrop);
+ },
+ onVerticalDragStart: isHorizontalNavigation
+ ? null
+ : (DragStartDetails dragStartDetails) {
+ _onVerticalStart(
+ dragStartDetails,
+ isResourceEnabled,
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ isNeedDragAndDrop);
+ },
+ onVerticalDragUpdate: isHorizontalNavigation
+ ? null
+ : (DragUpdateDetails dragUpdateDetails) {
+ _onVerticalUpdate(
+ dragUpdateDetails,
+ isResourceEnabled,
+ isMonthView,
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ resourceItemHeight,
+ weekNumberPanelWidth,
+ isNeedDragAndDrop);
+ },
+ onVerticalDragEnd: isHorizontalNavigation
+ ? null
+ : (DragEndDetails dragEndDetails) {
+ _onVerticalEnd(
+ dragEndDetails,
+ isResourceEnabled,
+ isTimelineView,
+ isMonthView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ weekNumberPanelWidth,
+ isNeedDragAndDrop);
+ },
);
-
- return Stack(
- children: [
- Positioned(
- left: leftPosition,
- right: rightPosition,
- bottom: bottomPosition,
- top: topPosition,
- child: FocusScope(
- node: _focusNode,
- onKey: _onKeyDown,
- child: isTimelineView
- ? Listener(
- onPointerSignal: _handlePointerSignal,
- child: RawGestureDetector(
- gestures: {
- HorizontalDragGestureRecognizer:
- GestureRecognizerFactoryWithHandlers<
- HorizontalDragGestureRecognizer>(
- () => HorizontalDragGestureRecognizer(),
- (HorizontalDragGestureRecognizer instance) {
- instance.onUpdate = _handleDragUpdate;
- instance.onStart = _handleDragStart;
- instance.onEnd = _handleDragEnd;
- instance.onCancel = _handleDragCancel;
- },
- )
- },
- behavior: HitTestBehavior.opaque,
- child: customScrollWidget),
- )
- : customScrollWidget,
- )),
- ],
+ return GestureDetector(
+ onLongPressStart: (LongPressStartDetails details) {
+ _handleLongPressStart(details, isNeedDragAndDrop, isTimelineView,
+ isResourceEnabled, viewHeaderHeight, timeLabelWidth);
+ },
+ onLongPressMoveUpdate: isNeedDragAndDrop
+ ? (LongPressMoveUpdateDetails details) {
+ _handleLongPressMove(
+ details.localPosition,
+ isTimelineView,
+ isResourceEnabled,
+ isMonthView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ resourceItemHeight,
+ weekNumberPanelWidth);
+ }
+ : null,
+ onLongPressEnd: isNeedDragAndDrop
+ ? (LongPressEndDetails details) {
+ _handleLongPressEnd(
+ details.localPosition,
+ isTimelineView,
+ isResourceEnabled,
+ isMonthView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ weekNumberPanelWidth);
+ }
+ : null,
+ child: Stack(
+ children: [
+ Positioned(
+ left: leftPosition,
+ right: rightPosition,
+ bottom: bottomPosition,
+ top: topPosition,
+ child: FocusScope(
+ node: _focusNode,
+ onKey: _onKeyDown,
+ child: isTimelineView
+ ? Listener(
+ onPointerSignal: _handlePointerSignal,
+ child: RawGestureDetector(
+ gestures: {
+ HorizontalDragGestureRecognizer:
+ GestureRecognizerFactoryWithHandlers<
+ HorizontalDragGestureRecognizer>(
+ () => HorizontalDragGestureRecognizer(),
+ (HorizontalDragGestureRecognizer instance) {
+ instance.onUpdate =
+ (DragUpdateDetails details) {
+ _handleDragUpdate(
+ details,
+ isTimelineView,
+ isResourceEnabled,
+ isMonthView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ resourceItemHeight,
+ weekNumberPanelWidth,
+ isNeedDragAndDrop,
+ resourceViewSize);
+ };
+ instance.onStart =
+ (DragStartDetails details) {
+ _handleDragStart(
+ details,
+ isNeedDragAndDrop,
+ isTimelineView,
+ isResourceEnabled,
+ viewHeaderHeight,
+ timeLabelWidth,
+ resourceViewSize);
+ };
+ instance.onEnd = (DragEndDetails details) {
+ _handleDragEnd(
+ details,
+ isTimelineView,
+ isResourceEnabled,
+ isMonthView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ weekNumberPanelWidth,
+ isNeedDragAndDrop);
+ };
+ instance.onCancel = _handleDragCancel;
+ },
+ )
+ },
+ behavior: HitTestBehavior.opaque,
+ child: customScrollWidget),
+ )
+ : customScrollWidget,
+ )),
+ Positioned(
+ left: 0,
+ right: 0,
+ bottom: 0,
+ top: 0,
+ child: IgnorePointer(
+ child: RepaintBoundary(
+ child: _DraggingAppointmentWidget(
+ _dragDetails,
+ widget.isRTL,
+ widget.textScaleFactor,
+ widget.isMobilePlatform,
+ widget.calendar.appointmentTextStyle,
+ widget.calendar.dragAndDropSettings,
+ widget.view,
+ _updateCalendarStateDetails.allDayPanelHeight,
+ viewHeaderHeight,
+ timeLabelWidth,
+ resourceItemHeight,
+ widget.calendarTheme,
+ widget.calendar,
+ widget.width,
+ widget.height))))
+ ],
+ ),
);
}
@@ -546,670 +752,2137 @@ class _CustomCalendarScrollViewState extends State
super.dispose();
}
- /// Get the scroll layout current child view state based on its visible dates.
- GlobalKey<_CalendarViewState>? _getCurrentViewByVisibleDates() {
- _CalendarView? view;
- for (int i = 0; i < _children.length; i++) {
- final _CalendarView currentView = _children[i];
- if (currentView.visibleDates == _currentViewVisibleDates) {
- view = currentView;
- break;
+ void _handleAppointmentDragStart(
+ AppointmentView appointmentView,
+ bool isTimelineView,
+ Offset details,
+ bool isResourceEnabled,
+ double viewHeaderHeight,
+ double timeLabelWidth) {
+ final _CalendarViewState currentState = _getCurrentViewByVisibleDates()!;
+ _dragDetails.value.appointmentView = appointmentView;
+ _dragDifferenceOffset = null;
+ final Offset appointmentPosition = Offset(
+ widget.isRTL
+ ? appointmentView.appointmentRect!.right
+ : appointmentView.appointmentRect!.left,
+ appointmentView.appointmentRect!.top);
+ double xPosition;
+ double yPosition;
+ if (isTimelineView) {
+ xPosition = (appointmentPosition.dx -
+ currentState._scrollController!.position.pixels) -
+ details.dx;
+ if (widget.isRTL) {
+ xPosition = currentState._scrollController!.offset +
+ currentState._scrollController!.position.viewportDimension;
+ xPosition = xPosition -
+ ((currentState._scrollController!.position.viewportDimension +
+ currentState._scrollController!.position.maxScrollExtent) -
+ appointmentPosition.dx);
+ xPosition -= details.dx;
+ }
+ yPosition = appointmentPosition.dy +
+ viewHeaderHeight +
+ timeLabelWidth -
+ details.dy;
+ if (isResourceEnabled) {
+ yPosition -= currentState._timelineViewVerticalScrollController!.offset;
+ }
+ _dragDifferenceOffset = Offset(xPosition, yPosition);
+ } else if (widget.view == CalendarView.month) {
+ xPosition = appointmentPosition.dx - details.dx;
+ yPosition = appointmentPosition.dy + viewHeaderHeight;
+ yPosition = yPosition - details.dy;
+ _dragDifferenceOffset = Offset(xPosition, yPosition);
+ } else {
+ final double allDayHeight = currentState._isExpanded
+ ? _updateCalendarStateDetails.allDayPanelHeight
+ : currentState._allDayHeight;
+ xPosition = appointmentPosition.dx - details.dx;
+ yPosition = appointmentPosition.dy +
+ viewHeaderHeight +
+ allDayHeight -
+ currentState._scrollController!.position.pixels;
+ if (appointmentView.appointment!.isAllDay ||
+ appointmentView.appointment!.isSpanned) {
+ yPosition = appointmentPosition.dy + viewHeaderHeight;
}
+ yPosition = yPosition - details.dy;
+ _dragDifferenceOffset = Offset(xPosition, yPosition);
}
- if (view == null) {
- return null;
+ CalendarResource? selectedResource;
+ int _selectedResourceIndex = -1;
+
+ if (isResourceEnabled) {
+ yPosition = details.dy - viewHeaderHeight - timeLabelWidth;
+ yPosition += currentState._timelineViewVerticalScrollController!.offset;
+ _selectedResourceIndex = currentState._getSelectedResourceIndex(
+ yPosition, viewHeaderHeight, timeLabelWidth);
+ selectedResource =
+ widget.calendar.dataSource!.resources![_selectedResourceIndex];
+ }
+ _dragDetails.value.position.value = details + _dragDifferenceOffset!;
+ _dragDetails.value.draggingTime =
+ yPosition <= 0 && widget.view != CalendarView.month && !isTimelineView
+ ? null
+ : _dragDetails.value.appointmentView!.appointment!.actualStartTime;
+ final dynamic dragStartAppointment = _getCalendarAppointmentToObject(
+ appointmentView.appointment!, widget.calendar);
+ if (widget.calendar.onDragStart != null) {
+ widget.calendar.onDragStart!(
+ AppointmentDragStartDetails(dragStartAppointment, selectedResource));
+ }
+ }
+
+ void _handleLongPressStart(
+ LongPressStartDetails details,
+ bool isNeedDragAndDrop,
+ bool isTimelineView,
+ bool isResourceEnabled,
+ double viewHeaderHeight,
+ double timeLabelWidth) {
+ final _CalendarViewState currentState = _getCurrentViewByVisibleDates()!;
+ AppointmentView? appointmentView =
+ _getDragAppointment(details, currentState);
+ if (!isNeedDragAndDrop || appointmentView == null) {
+ _dragDetails.value.position.value = null;
+ return;
}
- // ignore: avoid_as
- return view.key! as GlobalKey<_CalendarViewState>;
+ currentState._removeAllWidgetHovering();
+ appointmentView = appointmentView.clone();
+ _handleAppointmentDragStart(
+ appointmentView,
+ isTimelineView,
+ details.localPosition,
+ isResourceEnabled,
+ viewHeaderHeight,
+ timeLabelWidth);
}
- /// Handle start of the scroll, set the scroll start position and check
- /// the start position as start or end of timeline scroll controller.
- /// If the timeline view scroll starts at min or max scroll position then
- /// move the previous view to end of the scroll or move the next view to
- /// start of the scroll and set the drag as timeline scroll controller drag.
- void _handleDragStart(DragStartDetails details) {
- if (!CalendarViewHelper.isTimelineView(widget.view)) {
+ AppointmentView? _getDragAppointment(
+ LongPressStartDetails details, _CalendarViewState currentState) {
+ if (CalendarViewHelper.isTimelineView(widget.view)) {
+ return currentState._handleTouchOnTimeline(null, details);
+ } else if (widget.view == CalendarView.month) {
+ return currentState._handleTouchOnMonthView(null, details);
+ }
+
+ return currentState._handleTouchOnDayView(null, details);
+ }
+
+ void _handleLongPressMove(
+ Offset details,
+ bool isTimelineView,
+ bool isResourceEnabled,
+ bool isMonthView,
+ double viewHeaderHeight,
+ double timeLabelWidth,
+ double resourceItemHeight,
+ double weekNumberPanelWidth) {
+ if (_dragDetails.value.appointmentView == null) {
return;
}
- final GlobalKey<_CalendarViewState> viewKey =
- _getCurrentViewByVisibleDates()!;
- _timelineScrollStartPosition =
- viewKey.currentState!._scrollController!.position.pixels;
- _timelineStartPosition = details.globalPosition.dx;
- _isNeedTimelineScrollEnd = false;
- /// If the timeline view scroll starts at min or max scroll position then
- /// move the previous view to end of the scroll or move the next view to
- /// start of the scroll
- if (_timelineScrollStartPosition >=
- viewKey.currentState!._scrollController!.position.maxScrollExtent) {
- _positionTimelineView();
- } else if (_timelineScrollStartPosition <=
- viewKey.currentState!._scrollController!.position.minScrollExtent) {
- _positionTimelineView();
+ final Offset appointmentPosition = details + _dragDifferenceOffset!;
+ final _CalendarViewState currentState = _getCurrentViewByVisibleDates()!;
+ final double allDayHeight = currentState._isExpanded
+ ? _updateCalendarStateDetails.allDayPanelHeight
+ : currentState._allDayHeight;
+
+ final double timeIntervalHeight = currentState._getTimeIntervalHeight(
+ widget.calendar,
+ widget.view,
+ widget.width,
+ widget.height,
+ currentState.widget.visibleDates.length,
+ currentState._allDayHeight,
+ widget.isMobilePlatform);
+ if (isTimelineView) {
+ _updateAutoScrollDragTimelineView(
+ currentState,
+ appointmentPosition,
+ viewHeaderHeight,
+ timeIntervalHeight,
+ resourceItemHeight,
+ isResourceEnabled,
+ details,
+ isMonthView,
+ allDayHeight,
+ isTimelineView,
+ timeLabelWidth,
+ weekNumberPanelWidth);
+ } else {
+ _updateNavigationDayView(
+ currentState,
+ appointmentPosition,
+ viewHeaderHeight,
+ allDayHeight,
+ timeIntervalHeight,
+ timeLabelWidth,
+ isResourceEnabled,
+ isTimelineView,
+ isMonthView,
+ details,
+ weekNumberPanelWidth);
+ }
+
+ _dragDetails.value.position.value = appointmentPosition;
+ _updateAppointmentDragUpdateCallback(
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ allDayHeight,
+ appointmentPosition,
+ isMonthView,
+ timeIntervalHeight,
+ currentState,
+ details,
+ isResourceEnabled,
+ weekNumberPanelWidth);
+ }
+
+ Future _updateNavigationDayView(
+ _CalendarViewState currentState,
+ Offset appointmentPosition,
+ double viewHeaderHeight,
+ double allDayHeight,
+ double timeIntervalHeight,
+ double timeLabelWidth,
+ bool isResourceEnabled,
+ bool isTimelineView,
+ bool isMonthView,
+ Offset details,
+ double weekNumberPanelWidth) async {
+ if (_dragDetails.value.appointmentView == null) {
+ return;
}
- /// Set the drag as timeline scroll controller drag.
- if (viewKey.currentState!._scrollController!.hasClients) {
- _drag = viewKey.currentState!._scrollController!.position
- .drag(details, _disposeDrag);
+ double navigationThresholdValue = 0;
+ if (widget.view == CalendarView.day) {
+ navigationThresholdValue =
+ _dragDetails.value.appointmentView!.appointmentRect!.width * 0.1;
}
- }
- /// Handles the scroll update, if the scroll moves after the timeline max
- /// scroll position or before the timeline min scroll position then check the
- /// scroll start position if it is start or end of the timeline scroll view
- /// then pass the touch to custom scroll view and set the timeline view
- /// drag as null;
- void _handleDragUpdate(DragUpdateDetails details) {
- if (!CalendarViewHelper.isTimelineView(widget.view)) {
- return;
+ double rtlValue = 0;
+ if (widget.isRTL) {
+ rtlValue = _dragDetails.value.appointmentView!.appointmentRect!.width;
}
- final GlobalKey<_CalendarViewState> viewKey =
- _getCurrentViewByVisibleDates()!;
- /// Calculate the scroll difference by current scroll position and start
- /// scroll position.
- final double difference =
- details.globalPosition.dx - _timelineStartPosition;
- if (_timelineScrollStartPosition >=
- viewKey.currentState!._scrollController!.position.maxScrollExtent &&
- ((difference < 0 && !widget.isRTL) ||
- (difference > 0 && widget.isRTL))) {
- /// Set the scroll position as timeline scroll start position and the
- /// value used on horizontal update method.
- _scrollStartPosition = _timelineStartPosition;
- _drag?.cancel();
+ final bool isHorizontalNavigation =
+ widget.calendar.monthViewSettings.navigationDirection ==
+ MonthNavigationDirection.horizontal ||
+ widget.view != CalendarView.month;
- /// Move the touch(drag) to custom scroll view.
- _onHorizontalUpdate(details);
+ if (widget.calendar.dragAndDropSettings.allowScroll &&
+ widget.view != CalendarView.month &&
+ appointmentPosition.dy <= viewHeaderHeight + allDayHeight &&
+ currentState._scrollController!.position.pixels != 0) {
+ if (_timer != null) {
+ return;
+ }
+ _timer = Timer(const Duration(milliseconds: 200), () async {
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dy <=
+ viewHeaderHeight + allDayHeight &&
+ currentState._scrollController!.position.pixels != 0) {
+ Future _updateScrollPosition() async {
+ double scrollPosition =
+ currentState._scrollController!.position.pixels -
+ timeIntervalHeight;
+ if (scrollPosition < 0) {
+ scrollPosition = 0;
+ }
+ await currentState._scrollController!.position.moveTo(
+ scrollPosition,
+ duration: const Duration(milliseconds: 100),
+ curve: Curves.easeInOut,
+ );
+
+ _updateAppointmentDragUpdateCallback(
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ allDayHeight,
+ appointmentPosition,
+ isMonthView,
+ timeIntervalHeight,
+ currentState,
+ details,
+ isResourceEnabled,
+ weekNumberPanelWidth);
+
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dy <=
+ viewHeaderHeight + allDayHeight &&
+ currentState._scrollController!.position.pixels != 0) {
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ }
- /// Enable boolean value used to trigger the horizontal end animation on
- /// drag end.
- _isNeedTimelineScrollEnd = true;
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ });
+ } else if (widget.calendar.dragAndDropSettings.allowScroll &&
+ widget.view != CalendarView.month &&
+ appointmentPosition.dy +
+ _dragDetails.value.appointmentView!.appointmentRect!.height >=
+ widget.height &&
+ currentState._scrollController!.position.pixels !=
+ currentState._scrollController!.position.maxScrollExtent) {
+ if (_timer != null) {
+ return;
+ }
+ _timer = Timer(const Duration(milliseconds: 200), () async {
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dy +
+ _dragDetails
+ .value.appointmentView!.appointmentRect!.height >=
+ widget.height &&
+ currentState._scrollController!.position.pixels !=
+ currentState._scrollController!.position.maxScrollExtent) {
+ Future _updateScrollPosition() async {
+ double scrollPosition =
+ currentState._scrollController!.position.pixels +
+ timeIntervalHeight;
+ if (scrollPosition >
+ currentState._scrollController!.position.maxScrollExtent) {
+ scrollPosition =
+ currentState._scrollController!.position.maxScrollExtent;
+ }
- /// Remove the timeline view drag or scroll.
- _disposeDrag();
- return;
- } else if (_timelineScrollStartPosition <=
- viewKey.currentState!._scrollController!.position.minScrollExtent &&
- ((difference > 0 && !widget.isRTL) ||
- (difference < 0 && widget.isRTL))) {
- /// Set the scroll position as timeline scroll start position and the
- /// value used on horizontal update method.
- _scrollStartPosition = _timelineStartPosition;
- _drag?.cancel();
+ await currentState._scrollController!.position.moveTo(
+ scrollPosition,
+ duration: const Duration(milliseconds: 100),
+ curve: Curves.easeInOut,
+ );
+
+ _updateAppointmentDragUpdateCallback(
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ allDayHeight,
+ appointmentPosition,
+ isMonthView,
+ timeIntervalHeight,
+ currentState,
+ details,
+ isResourceEnabled,
+ weekNumberPanelWidth);
+
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dy +
+ _dragDetails
+ .value.appointmentView!.appointmentRect!.height >=
+ widget.height &&
+ currentState._scrollController!.position.pixels !=
+ currentState._scrollController!.position.maxScrollExtent) {
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ }
- /// Move the touch(drag) to custom scroll view.
- _onHorizontalUpdate(details);
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ });
+ } else if (widget.calendar.dragAndDropSettings.allowNavigation &&
+ ((isHorizontalNavigation &&
+ (appointmentPosition.dx +
+ _dragDetails.value.appointmentView!.appointmentRect!
+ .width) -
+ rtlValue >=
+ widget.width) ||
+ (!isHorizontalNavigation &&
+ (appointmentPosition.dy +
+ _dragDetails
+ .value.appointmentView!.appointmentRect!.height >=
+ widget.height)))) {
+ if (_timer != null) {
+ return;
+ }
+ _timer =
+ Timer.periodic(widget.calendar.dragAndDropSettings.autoNavigateDelay,
+ (Timer timer) async {
+ if (_dragDetails.value.position.value != null &&
+ ((isHorizontalNavigation &&
+ (_dragDetails.value.position.value!.dx +
+ _dragDetails.value.appointmentView!
+ .appointmentRect!.width) -
+ rtlValue >=
+ widget.width + navigationThresholdValue) ||
+ (!isHorizontalNavigation &&
+ _dragDetails.value.position.value!.dy +
+ _dragDetails.value.appointmentView!.appointmentRect!
+ .height >=
+ widget.height))) {
+ if (widget.isRTL) {
+ _moveToPreviousViewWithAnimation();
+ } else {
+ _moveToNextViewWithAnimation();
+ }
- /// Enable boolean value used to trigger the horizontal end animation on
- /// drag end.
- _isNeedTimelineScrollEnd = true;
+ _updateAppointmentDragUpdateCallback(
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ allDayHeight,
+ appointmentPosition,
+ isMonthView,
+ timeIntervalHeight,
+ currentState,
+ details,
+ isResourceEnabled,
+ weekNumberPanelWidth);
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ });
+ } else if (widget.calendar.dragAndDropSettings.allowNavigation &&
+ ((isHorizontalNavigation &&
+ (appointmentPosition.dx + navigationThresholdValue) -
+ rtlValue <=
+ 0) ||
+ (!isHorizontalNavigation &&
+ appointmentPosition.dy <= viewHeaderHeight))) {
+ if (_timer != null) {
+ return;
+ }
+ _timer = Timer.periodic(const Duration(seconds: 1), (Timer timer) async {
+ if (_dragDetails.value.position.value != null &&
+ ((isHorizontalNavigation &&
+ (_dragDetails.value.position.value!.dx +
+ navigationThresholdValue) -
+ rtlValue <=
+ 0) ||
+ (!isHorizontalNavigation &&
+ _dragDetails.value.position.value!.dy <=
+ viewHeaderHeight))) {
+ if (widget.isRTL) {
+ _moveToNextViewWithAnimation();
+ } else {
+ _moveToPreviousViewWithAnimation();
+ }
- /// Remove the timeline view drag or scroll.
- _disposeDrag();
+ _updateAppointmentDragUpdateCallback(
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ allDayHeight,
+ appointmentPosition,
+ isMonthView,
+ timeIntervalHeight,
+ currentState,
+ details,
+ isResourceEnabled,
+ weekNumberPanelWidth);
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ });
+ }
+ }
+
+ Future _updateAutoScrollDragTimelineView(
+ _CalendarViewState currentState,
+ Offset appointmentPosition,
+ double viewHeaderHeight,
+ double timeIntervalHeight,
+ double resourceItemHeight,
+ bool isResourceEnabled,
+ Offset details,
+ bool isMonthView,
+ double allDayHeight,
+ bool isTimelineView,
+ double timeLabelWidth,
+ double weekNumberPanelWidth) async {
+ if (_dragDetails.value.appointmentView == null) {
return;
}
- _drag?.update(details);
- }
+ double rtlValue = 0;
+ if (widget.isRTL) {
+ rtlValue = _dragDetails.value.appointmentView!.appointmentRect!.width;
+ }
+ if (widget.calendar.dragAndDropSettings.allowScroll &&
+ appointmentPosition.dx - rtlValue <= 0 &&
+ ((widget.isRTL &&
+ currentState._scrollController!.position.pixels !=
+ currentState._scrollController!.position.maxScrollExtent) ||
+ (!widget.isRTL &&
+ currentState._scrollController!.position.pixels != 0))) {
+ if (_timer != null) {
+ return;
+ }
+ _timer = Timer(const Duration(milliseconds: 200), () async {
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dx - rtlValue <= 0 &&
+ ((widget.isRTL &&
+ currentState._scrollController!.position.pixels !=
+ currentState
+ ._scrollController!.position.maxScrollExtent) ||
+ (!widget.isRTL &&
+ currentState._scrollController!.position.pixels != 0))) {
+ Future _updateScrollPosition() async {
+ double scrollPosition =
+ currentState._scrollController!.position.pixels -
+ timeIntervalHeight;
+ if (widget.isRTL) {
+ scrollPosition = currentState._scrollController!.position.pixels +
+ timeIntervalHeight;
+ }
+ if (!widget.isRTL && scrollPosition < 0) {
+ scrollPosition = 0;
+ } else if (widget.isRTL &&
+ scrollPosition >
+ currentState._scrollController!.position.maxScrollExtent) {
+ scrollPosition =
+ currentState._scrollController!.position.maxScrollExtent;
+ }
+ await currentState._scrollController!.position.moveTo(
+ scrollPosition,
+ duration: const Duration(milliseconds: 100),
+ curve: Curves.easeInOut,
+ );
+
+ _updateAppointmentDragUpdateCallback(
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ allDayHeight,
+ appointmentPosition,
+ isMonthView,
+ timeIntervalHeight,
+ currentState,
+ details,
+ isResourceEnabled,
+ weekNumberPanelWidth);
+
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dx - rtlValue <= 0 &&
+ ((widget.isRTL &&
+ currentState._scrollController!.position.pixels !=
+ currentState
+ ._scrollController!.position.maxScrollExtent) ||
+ (!widget.isRTL &&
+ currentState._scrollController!.position.pixels !=
+ 0))) {
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ _updateAutoViewNavigationTimelineView(
+ currentState,
+ appointmentPosition,
+ viewHeaderHeight,
+ timeIntervalHeight,
+ resourceItemHeight,
+ isResourceEnabled,
+ details,
+ isMonthView,
+ allDayHeight,
+ isTimelineView,
+ timeLabelWidth,
+ weekNumberPanelWidth,
+ rtlValue);
+ }
+ }
- /// Handle the scroll end to update the timeline view scroll or custom scroll
- /// view scroll based on [_isNeedTimelineScrollEnd] value
- void _handleDragEnd(DragEndDetails details) {
- if (_isNeedTimelineScrollEnd) {
- _isNeedTimelineScrollEnd = false;
- _onHorizontalEnd(details);
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ _updateAutoViewNavigationTimelineView(
+ currentState,
+ appointmentPosition,
+ viewHeaderHeight,
+ timeIntervalHeight,
+ resourceItemHeight,
+ isResourceEnabled,
+ details,
+ isMonthView,
+ allDayHeight,
+ isTimelineView,
+ timeLabelWidth,
+ weekNumberPanelWidth,
+ rtlValue);
+ }
+ });
+ } else if (widget.calendar.dragAndDropSettings.allowScroll &&
+ (appointmentPosition.dx +
+ _dragDetails
+ .value.appointmentView!.appointmentRect!.width) -
+ rtlValue >=
+ widget.width &&
+ ((widget.isRTL &&
+ currentState._scrollController!.position.pixels != 0) ||
+ (!widget.isRTL &&
+ currentState._scrollController!.position.pixels !=
+ currentState
+ ._scrollController!.position.maxScrollExtent))) {
+ if (_timer != null) {
+ return;
+ }
+ _timer = Timer(const Duration(milliseconds: 200), () async {
+ if (_dragDetails.value.position.value != null &&
+ (_dragDetails.value.position.value!.dx +
+ _dragDetails
+ .value.appointmentView!.appointmentRect!.width) -
+ rtlValue >=
+ widget.width &&
+ ((widget.isRTL &&
+ currentState._scrollController!.position.pixels != 0) ||
+ (!widget.isRTL &&
+ currentState._scrollController!.position.pixels !=
+ currentState
+ ._scrollController!.position.maxScrollExtent))) {
+ Future _updateScrollPosition() async {
+ double scrollPosition =
+ currentState._scrollController!.position.pixels +
+ timeIntervalHeight;
+ if (widget.isRTL) {
+ scrollPosition = currentState._scrollController!.position.pixels -
+ timeIntervalHeight;
+ }
+ if (!widget.isRTL &&
+ scrollPosition >
+ currentState._scrollController!.position.maxScrollExtent) {
+ scrollPosition =
+ currentState._scrollController!.position.maxScrollExtent;
+ } else if (widget.isRTL && scrollPosition < 0) {
+ scrollPosition = 0;
+ }
+
+ await currentState._scrollController!.position.moveTo(
+ scrollPosition,
+ duration: const Duration(milliseconds: 100),
+ curve: Curves.easeInOut,
+ );
+
+ _updateAppointmentDragUpdateCallback(
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ allDayHeight,
+ appointmentPosition,
+ isMonthView,
+ timeIntervalHeight,
+ currentState,
+ details,
+ isResourceEnabled,
+ weekNumberPanelWidth);
+
+ if (_dragDetails.value.position.value != null &&
+ (_dragDetails.value.position.value!.dx +
+ _dragDetails.value.appointmentView!.appointmentRect!
+ .width) -
+ rtlValue >=
+ widget.width &&
+ ((widget.isRTL &&
+ currentState._scrollController!.position.pixels != 0) ||
+ (!widget.isRTL &&
+ currentState._scrollController!.position.pixels !=
+ currentState._scrollController!.position
+ .maxScrollExtent))) {
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ _updateAutoViewNavigationTimelineView(
+ currentState,
+ appointmentPosition,
+ viewHeaderHeight,
+ timeIntervalHeight,
+ resourceItemHeight,
+ isResourceEnabled,
+ details,
+ isMonthView,
+ allDayHeight,
+ isTimelineView,
+ timeLabelWidth,
+ weekNumberPanelWidth,
+ rtlValue);
+ }
+ }
+
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ _updateAutoViewNavigationTimelineView(
+ currentState,
+ appointmentPosition,
+ viewHeaderHeight,
+ timeIntervalHeight,
+ resourceItemHeight,
+ isResourceEnabled,
+ details,
+ isMonthView,
+ allDayHeight,
+ isTimelineView,
+ timeLabelWidth,
+ weekNumberPanelWidth,
+ rtlValue);
+ }
+ });
+ }
+
+ _updateAutoViewNavigationTimelineView(
+ currentState,
+ appointmentPosition,
+ viewHeaderHeight,
+ timeIntervalHeight,
+ resourceItemHeight,
+ isResourceEnabled,
+ details,
+ isMonthView,
+ allDayHeight,
+ isTimelineView,
+ timeLabelWidth,
+ weekNumberPanelWidth,
+ rtlValue);
+
+ if (_dragDetails.value.appointmentView == null) {
return;
}
- _isNeedTimelineScrollEnd = false;
- _drag?.end(details);
- }
+ if (isResourceEnabled) {
+ if (widget.calendar.dragAndDropSettings.allowScroll &&
+ appointmentPosition.dy - viewHeaderHeight - timeIntervalHeight <= 0 &&
+ currentState._timelineViewVerticalScrollController!.position.pixels !=
+ 0) {
+ if (_timer != null) {
+ return;
+ }
+ _timer = Timer(const Duration(milliseconds: 200), () async {
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dy -
+ viewHeaderHeight -
+ timeIntervalHeight <=
+ 0 &&
+ currentState
+ ._timelineViewVerticalScrollController!.position.pixels !=
+ 0) {
+ Future _updateScrollPosition() async {
+ double scrollPosition = currentState
+ ._timelineViewVerticalScrollController!.position.pixels -
+ resourceItemHeight;
+ if (scrollPosition < 0) {
+ scrollPosition = 0;
+ }
+ await currentState._timelineViewVerticalScrollController!.position
+ .moveTo(
+ scrollPosition,
+ duration: const Duration(milliseconds: 100),
+ curve: Curves.easeInOut,
+ );
+
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dy -
+ viewHeaderHeight -
+ timeIntervalHeight <=
+ 0 &&
+ currentState._timelineViewVerticalScrollController!.position
+ .pixels !=
+ 0) {
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ }
- /// Handle drag cancel related operations.
- void _handleDragCancel() {
- _isNeedTimelineScrollEnd = false;
- _drag?.cancel();
- }
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ });
+ } else if (widget.calendar.dragAndDropSettings.allowScroll &&
+ appointmentPosition.dy +
+ _dragDetails.value.appointmentView!.appointmentRect!.height >=
+ widget.height &&
+ currentState._timelineViewVerticalScrollController!.position.pixels !=
+ currentState._timelineViewVerticalScrollController!.position
+ .maxScrollExtent) {
+ if (_timer != null) {
+ return;
+ }
+ _timer = Timer(const Duration(milliseconds: 200), () async {
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dy +
+ _dragDetails
+ .value.appointmentView!.appointmentRect!.height >=
+ widget.height &&
+ currentState
+ ._timelineViewVerticalScrollController!.position.pixels !=
+ currentState._timelineViewVerticalScrollController!.position
+ .maxScrollExtent) {
+ Future _updateScrollPosition() async {
+ double scrollPosition = currentState
+ ._timelineViewVerticalScrollController!.position.pixels +
+ resourceItemHeight;
+ if (scrollPosition >
+ currentState._timelineViewVerticalScrollController!.position
+ .maxScrollExtent) {
+ scrollPosition = currentState
+ ._timelineViewVerticalScrollController!
+ .position
+ .maxScrollExtent;
+ }
+
+ await currentState._timelineViewVerticalScrollController!.position
+ .moveTo(
+ scrollPosition,
+ duration: const Duration(milliseconds: 100),
+ curve: Curves.easeInOut,
+ );
+
+ if (_dragDetails.value.position.value != null &&
+ _dragDetails.value.position.value!.dy +
+ _dragDetails
+ .value.appointmentView!.appointmentRect!.height >=
+ widget.height &&
+ currentState._timelineViewVerticalScrollController!.position
+ .pixels !=
+ currentState._timelineViewVerticalScrollController!
+ .position.maxScrollExtent) {
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ }
- /// Remove the drag when the touch(drag) passed to custom scroll view.
- void _disposeDrag() {
- _drag = null;
+ _updateScrollPosition();
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ });
+ }
+ }
}
- /// Handle the pointer scroll when a pointer signal occurs over this object.
- /// eg., track pad scroll.
- void _handlePointerSignal(PointerSignalEvent event) {
- final GlobalKey<_CalendarViewState>? viewKey =
- _getCurrentViewByVisibleDates();
- if (event is PointerScrollEvent && viewKey != null) {
- final double scrolledPosition =
- widget.isRTL ? -event.scrollDelta.dx : event.scrollDelta.dx;
- final double targetScrollOffset = math.min(
- math.max(
- viewKey.currentState!._scrollController!.position.pixels +
- scrolledPosition,
- viewKey
- .currentState!._scrollController!.position.minScrollExtent),
- viewKey.currentState!._scrollController!.position.maxScrollExtent);
- if (targetScrollOffset !=
- viewKey.currentState!._scrollController!.position.pixels) {
- viewKey.currentState!._scrollController!.position
- .jumpTo(targetScrollOffset);
+ void _updateAutoViewNavigationTimelineView(
+ _CalendarViewState currentState,
+ Offset appointmentPosition,
+ double viewHeaderHeight,
+ double timeIntervalHeight,
+ double resourceItemHeight,
+ bool isResourceEnabled,
+ dynamic details,
+ bool isMonthView,
+ double allDayHeight,
+ bool isTimelineView,
+ double timeLabelWidth,
+ double weekNumberPanelWidth,
+ double rtlValue) {
+ if (widget.calendar.dragAndDropSettings.allowNavigation &&
+ (appointmentPosition.dx +
+ _dragDetails
+ .value.appointmentView!.appointmentRect!.width) -
+ rtlValue >=
+ widget.width &&
+ ((!widget.isRTL &&
+ currentState._scrollController!.offset ==
+ currentState._scrollController!.position.maxScrollExtent) ||
+ (widget.isRTL && currentState._scrollController!.offset == 0))) {
+ if (_timer != null) {
+ return;
}
+ _timer =
+ Timer.periodic(widget.calendar.dragAndDropSettings.autoNavigateDelay,
+ (Timer timer) async {
+ if (_dragDetails.value.position.value != null &&
+ (_dragDetails.value.position.value!.dx +
+ _dragDetails
+ .value.appointmentView!.appointmentRect!.width) -
+ rtlValue >=
+ widget.width &&
+ ((!widget.isRTL &&
+ currentState._scrollController!.offset ==
+ currentState
+ ._scrollController!.position.maxScrollExtent) ||
+ (widget.isRTL &&
+ currentState._scrollController!.offset == 0))) {
+ if (widget.isRTL) {
+ _moveToPreviousViewWithAnimation(isScrollToEnd: true);
+ } else {
+ _moveToNextViewWithAnimation();
+ }
+ currentState = _getCurrentViewByVisibleDates()!;
+ _updateAppointmentDragUpdateCallback(
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ allDayHeight,
+ appointmentPosition,
+ isMonthView,
+ timeIntervalHeight,
+ currentState,
+ details,
+ isResourceEnabled,
+ weekNumberPanelWidth);
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ });
+ } else if (widget.calendar.dragAndDropSettings.allowNavigation &&
+ ((appointmentPosition.dx) - rtlValue).truncate() <= 0 &&
+ ((widget.isRTL &&
+ currentState._scrollController!.position.pixels ==
+ currentState._scrollController!.position.maxScrollExtent) ||
+ (!widget.isRTL && currentState._scrollController!.offset == 0))) {
+ if (_timer != null) {
+ return;
+ }
+ _timer = Timer.periodic(const Duration(seconds: 1), (Timer timer) async {
+ if (_dragDetails.value.position.value != null &&
+ (_dragDetails.value.position.value!.dx - rtlValue).truncate() <=
+ 0 &&
+ ((widget.isRTL &&
+ currentState._scrollController!.position.pixels ==
+ currentState
+ ._scrollController!.position.maxScrollExtent) ||
+ (!widget.isRTL &&
+ currentState._scrollController!.offset == 0))) {
+ if (widget.isRTL) {
+ _moveToNextViewWithAnimation();
+ } else {
+ _moveToPreviousViewWithAnimation(isScrollToEnd: true);
+ }
+ currentState = _getCurrentViewByVisibleDates()!;
+
+ _updateAppointmentDragUpdateCallback(
+ isTimelineView,
+ viewHeaderHeight,
+ timeLabelWidth,
+ allDayHeight,
+ appointmentPosition,
+ isMonthView,
+ timeIntervalHeight,
+ currentState,
+ details,
+ isResourceEnabled,
+ weekNumberPanelWidth);
+ } else if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
+ }
+ });
}
}
- void _updateVisibleDates() {
- widget.getCalendarState(_updateCalendarStateDetails);
- final DateTime currentDate = DateTime(
- _updateCalendarStateDetails.currentDate!.year,
- _updateCalendarStateDetails.currentDate!.month,
- _updateCalendarStateDetails.currentDate!.day);
- final DateTime prevDate = DateTimeHelper.getPreviousViewStartDate(
- widget.view,
- widget.calendar.monthViewSettings.numberOfWeeksInView,
- currentDate);
- final DateTime nextDate = DateTimeHelper.getNextViewStartDate(widget.view,
- widget.calendar.monthViewSettings.numberOfWeeksInView, currentDate);
- final List? nonWorkingDays = (widget.view == CalendarView.workWeek ||
- widget.view == CalendarView.timelineWorkWeek)
- ? widget.calendar.timeSlotViewSettings.nonWorkingDays
- : null;
- final int visibleDatesCount = DateTimeHelper.getViewDatesCount(
- widget.view, widget.calendar.monthViewSettings.numberOfWeeksInView);
-
- _visibleDates = getVisibleDates(currentDate, nonWorkingDays,
- widget.calendar.firstDayOfWeek, visibleDatesCount)
- .cast();
- _previousViewVisibleDates = getVisibleDates(
- widget.isRTL ? nextDate : prevDate,
- nonWorkingDays,
- widget.calendar.firstDayOfWeek,
- visibleDatesCount)
- .cast();
- _nextViewVisibleDates = getVisibleDates(widget.isRTL ? prevDate : nextDate,
- nonWorkingDays, widget.calendar.firstDayOfWeek, visibleDatesCount)
- .cast();
- if (widget.view == CalendarView.timelineMonth) {
- _visibleDates = DateTimeHelper.getCurrentMonthDates(_visibleDates);
- _previousViewVisibleDates =
- DateTimeHelper.getCurrentMonthDates(_previousViewVisibleDates);
- _nextViewVisibleDates =
- DateTimeHelper.getCurrentMonthDates(_nextViewVisibleDates);
+ void _updateAppointmentDragUpdateCallback(
+ bool isTimelineView,
+ double viewHeaderHeight,
+ double timeLabelWidth,
+ double allDayHeight,
+ Offset appointmentPosition,
+ bool isMonthView,
+ double timeIntervalHeight,
+ _CalendarViewState currentState,
+ Offset details,
+ bool isResourceEnabled,
+ double weekNumberPanelWidth) {
+ if (_dragDetails.value.appointmentView == null) {
+ return;
}
- _currentViewVisibleDates = _visibleDates;
- _updateCalendarStateDetails.currentViewVisibleDates =
- _currentViewVisibleDates;
- widget.updateCalendarState(_updateCalendarStateDetails);
+ late DateTime draggingTime;
+ double xPosition = details.dx;
+ double yPosition = appointmentPosition.dy;
+ if (isTimelineView) {
+ xPosition = appointmentPosition.dx;
+ yPosition -= viewHeaderHeight + timeLabelWidth;
+ } else {
+ if (widget.view == CalendarView.month) {
+ if (yPosition < viewHeaderHeight) {
+ yPosition = viewHeaderHeight;
+ } else if (yPosition > widget.height - 1) {
+ yPosition = widget.height - 1;
+ }
- if (_currentChildIndex == 0) {
- _visibleDates = _nextViewVisibleDates;
- _nextViewVisibleDates = _previousViewVisibleDates;
- _previousViewVisibleDates = _currentViewVisibleDates;
- } else if (_currentChildIndex == 1) {
- _visibleDates = _currentViewVisibleDates;
- } else if (_currentChildIndex == 2) {
- _visibleDates = _previousViewVisibleDates;
- _previousViewVisibleDates = _nextViewVisibleDates;
- _nextViewVisibleDates = _currentViewVisibleDates;
+ yPosition -= viewHeaderHeight;
+ if (!widget.isRTL && xPosition <= weekNumberPanelWidth) {
+ xPosition = weekNumberPanelWidth;
+ } else if (widget.isRTL &&
+ xPosition >= (widget.width - weekNumberPanelWidth)) {
+ xPosition = widget.width - weekNumberPanelWidth;
+ }
+ } else {
+ if (yPosition < viewHeaderHeight + allDayHeight) {
+ yPosition = viewHeaderHeight + allDayHeight;
+ } else if (yPosition > widget.height - 1) {
+ yPosition = widget.height - 1;
+ }
+
+ yPosition -= viewHeaderHeight + allDayHeight;
+ if (!widget.isRTL) {
+ xPosition -= timeLabelWidth;
+ }
+ }
}
- }
- void _updateNextViewVisibleDates() {
- DateTime currentViewDate = _currentViewVisibleDates[0];
- if (widget.view == CalendarView.month &&
- widget.calendar.monthViewSettings.numberOfWeeksInView == 6) {
- currentViewDate = _currentViewVisibleDates[
- (_currentViewVisibleDates.length / 2).truncate()];
+ if (xPosition < 0) {
+ xPosition = 0;
+ } else if (xPosition > widget.width) {
+ xPosition = widget.width;
}
- if (widget.isRTL) {
- currentViewDate = DateTimeHelper.getPreviousViewStartDate(
- widget.view,
- widget.calendar.monthViewSettings.numberOfWeeksInView,
- currentViewDate);
- } else {
- currentViewDate = DateTimeHelper.getNextViewStartDate(
- widget.view,
- widget.calendar.monthViewSettings.numberOfWeeksInView,
- currentViewDate);
+ draggingTime = currentState._getDateFromPosition(
+ xPosition, yPosition, timeLabelWidth)!;
+ if (!isMonthView) {
+ if (isTimelineView) {
+ final DateTime time = _timeFromPosition(
+ draggingTime,
+ widget.calendar.timeSlotViewSettings,
+ xPosition,
+ currentState,
+ timeIntervalHeight,
+ isTimelineView)!;
+
+ draggingTime = DateTime(draggingTime.year, draggingTime.month,
+ draggingTime.day, time.hour, time.minute);
+ } else {
+ if (yPosition < 0) {
+ draggingTime = DateTime(
+ draggingTime.year, draggingTime.month, draggingTime.day, 0, 0, 0);
+ } else {
+ draggingTime = _timeFromPosition(
+ draggingTime,
+ widget.calendar.timeSlotViewSettings,
+ yPosition,
+ currentState,
+ timeIntervalHeight,
+ isTimelineView)!;
+ }
+ }
}
- List dates = getVisibleDates(
- currentViewDate,
- widget.view == CalendarView.workWeek ||
- widget.view == CalendarView.timelineWorkWeek
- ? widget.calendar.timeSlotViewSettings.nonWorkingDays
- : null,
- widget.calendar.firstDayOfWeek,
- DateTimeHelper.getViewDatesCount(widget.view,
- widget.calendar.monthViewSettings.numberOfWeeksInView))
- .cast();
+ _dragDetails.value.position.value = Offset(
+ _dragDetails.value.position.value!.dx,
+ _dragDetails.value.position.value!.dy - 0.1);
+ _dragDetails.value.draggingTime =
+ yPosition <= 0 && widget.view != CalendarView.month && !isTimelineView
+ ? null
+ : draggingTime;
+ _dragDetails.value.position.value = Offset(
+ _dragDetails.value.position.value!.dx,
+ _dragDetails.value.position.value!.dy + 0.1);
- if (widget.view == CalendarView.timelineMonth) {
- dates = DateTimeHelper.getCurrentMonthDates(dates);
+ if (widget.calendar.onDragUpdate == null) {
+ return;
}
- if (_currentChildIndex == 0) {
- _nextViewVisibleDates = dates;
- } else if (_currentChildIndex == 1) {
- _previousViewVisibleDates = dates;
- } else {
- _visibleDates = dates;
+ final dynamic draggingAppointment = _getCalendarAppointmentToObject(
+ _dragDetails.value.appointmentView!.appointment, widget.calendar);
+
+ CalendarResource? selectedResource, previousResource;
+ int targetResourceIndex = -1;
+ int sourceSelectedResourceIndex = -1;
+ if (isResourceEnabled) {
+ targetResourceIndex = currentState._getSelectedResourceIndex(
+ appointmentPosition.dy +
+ currentState._timelineViewVerticalScrollController!.offset,
+ viewHeaderHeight,
+ timeLabelWidth);
+ if (targetResourceIndex >
+ widget.calendar.dataSource!.resources!.length - 1) {
+ targetResourceIndex = widget.calendar.dataSource!.resources!.length - 1;
+ }
+ selectedResource =
+ widget.calendar.dataSource!.resources![targetResourceIndex];
+ sourceSelectedResourceIndex = currentState._getSelectedResourceIndex(
+ _dragDetails.value.appointmentView!.appointmentRect!.top,
+ viewHeaderHeight,
+ timeLabelWidth);
+ previousResource =
+ widget.calendar.dataSource!.resources![sourceSelectedResourceIndex];
+ }
+ if (widget.calendar.onDragUpdate != null) {
+ widget.calendar.onDragUpdate!(AppointmentDragUpdateDetails(
+ draggingAppointment,
+ previousResource,
+ selectedResource,
+ appointmentPosition,
+ _dragDetails.value.draggingTime!));
+ }
+ }
+
+ void _handleLongPressEnd(
+ Offset details,
+ bool isTimelineView,
+ bool isResourceEnabled,
+ bool isMonthView,
+ double viewHeaderHeight,
+ double timeLabelWidth,
+ double weekNumberPanelWidth) {
+ if (_dragDetails.value.appointmentView == null) {
+ return;
}
- }
- void _updatePreviousViewVisibleDates() {
- DateTime currentViewDate = _currentViewVisibleDates[0];
- if (widget.view == CalendarView.month &&
- widget.calendar.monthViewSettings.numberOfWeeksInView == 6) {
- currentViewDate = _currentViewVisibleDates[
- (_currentViewVisibleDates.length / 2).truncate()];
+ if (_timer != null) {
+ _timer!.cancel();
+ _timer = null;
}
- if (widget.isRTL) {
- currentViewDate = DateTimeHelper.getNextViewStartDate(
- widget.view,
- widget.calendar.monthViewSettings.numberOfWeeksInView,
- currentViewDate);
+ final Offset appointmentPosition = details + _dragDifferenceOffset!;
+ final _CalendarViewState currentState = _getCurrentViewByVisibleDates()!;
+ final double allDayHeight = currentState._isExpanded
+ ? _updateCalendarStateDetails.allDayPanelHeight
+ : currentState._allDayHeight;
+ final double timeIntervalHeight = currentState._getTimeIntervalHeight(
+ widget.calendar,
+ widget.view,
+ widget.width,
+ widget.height,
+ currentState.widget.visibleDates.length,
+ currentState._allDayHeight,
+ widget.isMobilePlatform);
+ double xPosition = details.dx;
+ double yPosition = appointmentPosition.dy;
+ if (isTimelineView) {
+ xPosition = !isMonthView ? appointmentPosition.dx : xPosition;
+ yPosition -= viewHeaderHeight + timeLabelWidth;
} else {
- currentViewDate = DateTimeHelper.getPreviousViewStartDate(
- widget.view,
- widget.calendar.monthViewSettings.numberOfWeeksInView,
- currentViewDate);
+ if (widget.view == CalendarView.month) {
+ if (yPosition < viewHeaderHeight) {
+ yPosition = viewHeaderHeight;
+ } else if (yPosition > widget.height - 1) {
+ yPosition = widget.height - 1;
+ }
+
+ yPosition -= viewHeaderHeight;
+ if (!widget.isRTL && xPosition <= weekNumberPanelWidth) {
+ xPosition = weekNumberPanelWidth;
+ } else if (widget.isRTL &&
+ xPosition >= (widget.width - weekNumberPanelWidth)) {
+ xPosition = widget.width - weekNumberPanelWidth;
+ }
+ } else {
+ yPosition -= viewHeaderHeight + allDayHeight;
+ if (!widget.isRTL) {
+ xPosition -= timeLabelWidth;
+ }
+ }
}
- List dates = getVisibleDates(
- currentViewDate,
- widget.view == CalendarView.workWeek ||
- widget.view == CalendarView.timelineWorkWeek
- ? widget.calendar.timeSlotViewSettings.nonWorkingDays
- : null,
- widget.calendar.firstDayOfWeek,
- DateTimeHelper.getViewDatesCount(widget.view,
- widget.calendar.monthViewSettings.numberOfWeeksInView))
- .cast();
+ if (xPosition < 0) {
+ xPosition = 0;
+ } else if (xPosition > widget.width) {
+ xPosition = widget.width;
+ }
- if (widget.view == CalendarView.timelineMonth) {
- dates = DateTimeHelper.getCurrentMonthDates(dates);
+ final CalendarAppointment? appointment =
+ _dragDetails.value.appointmentView!.appointment;
+ DateTime? dropTime = currentState._getDateFromPosition(
+ xPosition, yPosition, timeLabelWidth)!;
+ if (!isMonthView) {
+ if (isTimelineView) {
+ final DateTime time = _timeFromPosition(
+ dropTime,
+ widget.calendar.timeSlotViewSettings,
+ xPosition,
+ currentState,
+ timeIntervalHeight,
+ isTimelineView)!;
+ dropTime = DateTime(dropTime.year, dropTime.month, dropTime.day,
+ time.hour, time.minute);
+ } else {
+ dropTime = _timeFromPosition(
+ dropTime,
+ widget.calendar.timeSlotViewSettings,
+ yPosition,
+ currentState,
+ timeIntervalHeight,
+ isTimelineView)!;
+ }
}
- if (_currentChildIndex == 0) {
- _visibleDates = dates;
- } else if (_currentChildIndex == 1) {
- _nextViewVisibleDates = dates;
+ CalendarResource? selectedResource, previousResource;
+ int targetResourceIndex = -1;
+ int sourceSelectedResourceIndex = -1;
+ if (isResourceEnabled) {
+ targetResourceIndex = currentState._getSelectedResourceIndex(
+ (details.dy - viewHeaderHeight - timeLabelWidth) +
+ currentState._timelineViewVerticalScrollController!.offset,
+ viewHeaderHeight,
+ timeLabelWidth);
+ if (targetResourceIndex >
+ widget.calendar.dataSource!.resources!.length - 1) {
+ targetResourceIndex = widget.calendar.dataSource!.resources!.length - 1;
+ }
+ selectedResource =
+ widget.calendar.dataSource!.resources![targetResourceIndex];
+ sourceSelectedResourceIndex = currentState._getSelectedResourceIndex(
+ _dragDetails.value.appointmentView!.appointmentRect!.top,
+ viewHeaderHeight,
+ timeLabelWidth);
+ previousResource =
+ widget.calendar.dataSource!.resources![sourceSelectedResourceIndex];
+ }
+
+ final int currentMonth = currentState.widget
+ .visibleDates[currentState.widget.visibleDates.length ~/ 2].month;
+
+ if (!_isSelectedDateEnabled(dropTime, targetResourceIndex) ||
+ (widget.view == CalendarView.month &&
+ !CalendarViewHelper.isCurrentMonthDate(
+ widget.calendar.monthViewSettings.numberOfWeeksInView,
+ widget.calendar.monthViewSettings.showTrailingAndLeadingDates,
+ currentMonth,
+ dropTime))) {
+ if (widget.calendar.onDragEnd != null) {
+ widget.calendar.onDragEnd!(AppointmentDragEndDetails(
+ _getCalendarAppointmentToObject(appointment, widget.calendar),
+ previousResource,
+ previousResource,
+ appointment!.exactStartTime));
+ }
+ _dragDetails.value.appointmentView = null;
+ _dragDetails.value.position.value = null;
+ _dragDifferenceOffset = null;
+ currentState._hoveringAppointmentView = null;
+ return;
+ }
+ bool _isAllDay = appointment!.isAllDay;
+ if (!isTimelineView && widget.view != CalendarView.month) {
+ _isAllDay = yPosition < 0;
+ if (_dragDetails.value.appointmentView!.appointment!.isSpanned &&
+ !appointment.isAllDay) {
+ _isAllDay = appointment.isAllDay;
+ }
} else {
- _previousViewVisibleDates = dates;
+ _isAllDay = appointment.isAllDay;
}
- }
-
- void _getCalendarViewStateDetails(UpdateCalendarStateDetails details) {
- widget.getCalendarState(_updateCalendarStateDetails);
- details.currentDate = _updateCalendarStateDetails.currentDate;
- details.currentViewVisibleDates =
- _updateCalendarStateDetails.currentViewVisibleDates;
- details.selectedDate = _updateCalendarStateDetails.selectedDate;
- details.allDayPanelHeight = _updateCalendarStateDetails.allDayPanelHeight;
- details.allDayAppointmentViewCollection =
- _updateCalendarStateDetails.allDayAppointmentViewCollection;
- details.appointments = _updateCalendarStateDetails.appointments;
- details.visibleAppointments =
- _updateCalendarStateDetails.visibleAppointments;
- }
- void _updateCalendarViewStateDetails(UpdateCalendarStateDetails details) {
- _updateCalendarStateDetails.selectedDate = details.selectedDate;
- widget.updateCalendarState(_updateCalendarStateDetails);
- }
+ DateTime updateStartTime = _isAllDay
+ ? DateTime(dropTime.year, dropTime.month, dropTime.day, 0, 0, 0)
+ : dropTime;
- CalendarTimeRegion _getCalendarTimeRegionFromTimeRegion(TimeRegion region) {
- return CalendarTimeRegion(
- startTime: region.startTime,
- endTime: region.endTime,
- color: region.color,
- text: region.text,
- textStyle: region.textStyle,
- recurrenceExceptionDates: region.recurrenceExceptionDates,
- recurrenceRule: region.recurrenceRule,
- resourceIds: region.resourceIds,
- timeZone: region.timeZone,
- enablePointerInteraction: region.enablePointerInteraction,
- iconData: region.iconData,
- );
- }
+ final Duration appointmentDuration = appointment.isAllDay &&
+ widget.view != CalendarView.month &&
+ !isTimelineView
+ ? const Duration(hours: 1)
+ : appointment.endTime.difference(appointment.startTime);
+ DateTime updatedEndTime =
+ _isAllDay ? updateStartTime : updateStartTime.add(appointmentDuration);
+
+ CalendarAppointment? parentAppointment;
+ if ((appointment.recurrenceRule != null &&
+ appointment.recurrenceRule!.isNotEmpty) ||
+ appointment.recurrenceId != null) {
+ for (int i = 0;
+ i < _updateCalendarStateDetails.appointments.length;
+ i++) {
+ final CalendarAppointment app =
+ _updateCalendarStateDetails.appointments[i];
+ if (app.id == appointment.id || app.id == appointment.recurrenceId) {
+ parentAppointment = app;
+ break;
+ }
+ }
- /// Return collection of time region, in between the visible dates.
- List _getRegions(List visibleDates) {
- final DateTime visibleStartDate = visibleDates[0];
- final DateTime visibleEndDate = visibleDates[visibleDates.length - 1];
- final List regionCollection = [];
- if (_timeRegions == null) {
- return regionCollection;
- }
+ final List recurrenceDates =
+ RecurrenceHelper.getRecurrenceDateTimeCollection(
+ parentAppointment!.recurrenceRule ?? '',
+ parentAppointment.exactStartTime,
+ recurrenceDuration: AppointmentHelper.getDifference(
+ parentAppointment.exactStartTime,
+ parentAppointment.exactEndTime),
+ specificStartDate: currentState.widget.visibleDates[0],
+ specificEndDate: currentState.widget
+ .visibleDates[currentState.widget.visibleDates.length - 1]);
+
+ for (int i = 0;
+ i < _updateCalendarStateDetails.appointments.length;
+ i++) {
+ final CalendarAppointment calendarApp =
+ _updateCalendarStateDetails.appointments[i];
+ if (calendarApp.recurrenceId != null &&
+ calendarApp.recurrenceId == parentAppointment.id) {
+ recurrenceDates.add(
+ AppointmentHelper.convertTimeToAppointmentTimeZone(
+ calendarApp.startTime,
+ calendarApp.startTimeZone,
+ widget.calendar.timeZone));
+ }
+ }
- final DateTime startDate =
- AppointmentHelper.convertToStartTime(visibleStartDate);
- final DateTime endDate = AppointmentHelper.convertToEndTime(visibleEndDate);
- for (int j = 0; j < _timeRegions!.length; j++) {
- final TimeRegion timeRegion = _timeRegions![j];
- final CalendarTimeRegion region =
- _getCalendarTimeRegionFromTimeRegion(timeRegion);
- region.actualStartTime =
- AppointmentHelper.convertTimeToAppointmentTimeZone(
- region.startTime, region.timeZone, widget.calendar.timeZone);
- region.actualEndTime = AppointmentHelper.convertTimeToAppointmentTimeZone(
- region.endTime, region.timeZone, widget.calendar.timeZone);
- region.data = timeRegion;
+ if (parentAppointment.recurrenceExceptionDates != null) {
+ for (int i = 0;
+ i < parentAppointment.recurrenceExceptionDates!.length;
+ i++) {
+ recurrenceDates.remove(
+ AppointmentHelper.convertTimeToAppointmentTimeZone(
+ parentAppointment.recurrenceExceptionDates![i],
+ '',
+ widget.calendar.timeZone));
+ }
+ }
- if (region.recurrenceRule == null || region.recurrenceRule == '') {
- if (AppointmentHelper.isDateRangeWithinVisibleDateRange(
- region.actualStartTime, region.actualEndTime, startDate, endDate)) {
- regionCollection.add(region);
+ recurrenceDates.sort();
+ bool canAddRecurrence =
+ isSameDate(appointment.exactStartTime, updateStartTime);
+ if (!CalendarViewHelper.isDateInDateCollection(
+ recurrenceDates, updateStartTime)) {
+ final int currentRecurrenceIndex =
+ recurrenceDates.indexOf(appointment.exactStartTime);
+ if (currentRecurrenceIndex == 0 ||
+ currentRecurrenceIndex == recurrenceDates.length - 1) {
+ canAddRecurrence = true;
+ } else if (currentRecurrenceIndex < 0) {
+ canAddRecurrence = false;
+ } else {
+ final DateTime previousRecurrence =
+ recurrenceDates[currentRecurrenceIndex - 1];
+ final DateTime nextRecurrence =
+ recurrenceDates[currentRecurrenceIndex + 1];
+ canAddRecurrence = (isDateWithInDateRange(
+ previousRecurrence, nextRecurrence, updateStartTime) &&
+ !isSameDate(previousRecurrence, updateStartTime) &&
+ !isSameDate(nextRecurrence, updateStartTime)) ||
+ canAddRecurrence;
}
+ }
- continue;
+ if (!canAddRecurrence) {
+ if (widget.calendar.onDragEnd != null) {
+ widget.calendar.onDragEnd!(AppointmentDragEndDetails(
+ _getCalendarAppointmentToObject(appointment, widget.calendar),
+ previousResource,
+ previousResource,
+ appointment.exactStartTime));
+ }
+ _dragDetails.value.appointmentView = null;
+ _dragDetails.value.position.value = null;
+ _dragDifferenceOffset = null;
+ return;
}
- getRecurrenceRegions(region, regionCollection, startDate, endDate,
- widget.calendar.timeZone);
+ if (appointment.recurrenceId != null &&
+ (appointment.recurrenceRule == null ||
+ appointment.recurrenceRule!.isEmpty)) {
+ widget.calendar.dataSource!.appointments!.remove(appointment.data);
+ widget.calendar.dataSource!.notifyListeners(
+ CalendarDataSourceAction.remove, [appointment.data]);
+ } else {
+ widget.calendar.dataSource!.appointments!
+ .remove(parentAppointment.data);
+ widget.calendar.dataSource!.notifyListeners(
+ CalendarDataSourceAction.remove, [parentAppointment.data]);
+ final DateTime exceptionDate =
+ AppointmentHelper.convertTimeToAppointmentTimeZone(
+ appointment.exactStartTime, widget.calendar.timeZone, '');
+ parentAppointment.recurrenceExceptionDates != null
+ ? parentAppointment.recurrenceExceptionDates!.add(exceptionDate)
+ : parentAppointment.recurrenceExceptionDates = [
+ exceptionDate
+ ];
+
+ appointment.id =
+ appointment.recurrenceId != null ? appointment.id : null;
+ appointment.recurrenceId =
+ appointment.recurrenceId ?? parentAppointment.id;
+ appointment.recurrenceRule = null;
+ final dynamic newParentAppointment =
+ _getCalendarAppointmentToObject(parentAppointment, widget.calendar);
+ widget.calendar.dataSource!.appointments!.add(newParentAppointment);
+ widget.calendar.dataSource!.notifyListeners(
+ CalendarDataSourceAction.add, [newParentAppointment]);
+ }
+ } else {
+ widget.calendar.dataSource!.appointments!.remove(appointment.data);
+ widget.calendar.dataSource!.notifyListeners(
+ CalendarDataSourceAction.remove, [appointment.data]);
+ }
+
+ final DateTime callbackStartDate = updateStartTime;
+ updateStartTime = AppointmentHelper.convertTimeToAppointmentTimeZone(
+ updateStartTime, widget.calendar.timeZone, appointment.startTimeZone);
+ updatedEndTime = AppointmentHelper.convertTimeToAppointmentTimeZone(
+ updatedEndTime, widget.calendar.timeZone, appointment.endTimeZone);
+ appointment.startTime = updateStartTime;
+ appointment.endTime = updatedEndTime;
+ appointment.isAllDay = _isAllDay;
+ if (isResourceEnabled) {
+ if (appointment.resourceIds != null &&
+ appointment.resourceIds!.isNotEmpty) {
+ if (previousResource!.id != selectedResource!.id &&
+ !appointment.resourceIds!.contains(selectedResource.id)) {
+ appointment.resourceIds!.remove(previousResource.id);
+ appointment.resourceIds!.add(selectedResource.id);
+ }
+ } else {
+ appointment.resourceIds =