Skip to content

Commit a9f08fa

Browse files
Merge pull request #26 from syncfusion-content/FLUT-5947-vol4-UG-doc
FLUT-5947- [Feature] UG document for calendar and date picker
2 parents d46d0a7 + 806c313 commit a9f08fa

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

Flutter/DateRangePicker/selections.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,33 @@ Extend the selected range with the new selected date in any date range picker vi
139139
>**NOTE**
140140
* The hovering effect which occurs while extending the range will not be displayed when the `DateRangePickerNavigationMode` is set as `DateRangePickerNavigationMode.scroll`.
141141

142+
## Extendable range selection Direction
143+
It allows to extend the selection direction by using the [extendableRangeSelectionDirection]() property of the DateRangePicker.
144+
You can set the extendable range selection direction as forward, backward, both and none.
145+
146+
{% tabs %}
147+
{% highlight Dart %}
148+
149+
@override
150+
Widget build(BuildContext context) {
151+
return MaterialApp(
152+
home: Scaffold(
153+
body: SfDateRangePicker(
154+
view: DateRangePickerView.month,
155+
selectionMode: DateRangePickerSelectionMode.extendableRange,
156+
extendableRangeSelectionDirection:
157+
ExtendableRangeSelectionDirection.forward,
158+
),
159+
));
160+
}
161+
162+
{% endhighlight %}
163+
{% endtabs %}
164+
165+
>**NOTE**
166+
* If it is set to none, it won't allow to extend the selection. It will remain in the initial range.
167+
* If it is set to forward direction, the start date will not be changed here.
168+
* If it is set to backward direction, the end date will not be changed here.
142169

143170
## Selection radius
144171
Customize the radius of the selection using the [selectionRadius](https://pub.dev/documentation/syncfusion_flutter_datepicker/latest/datepicker/SfDateRangePicker/selectionRadius.html) property of the `SfDateRangePicker`.

Flutter/calendar/callbacks.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,46 @@ Widget build(BuildContext context) {
7676
>**NOTE**
7777
* For recurrence appointment, the tap details will always return as `Appointment`, even for the custom business object.
7878

79+
## Calendar details callback
80+
81+
Return calendar details based on the given offset passed through argument by using the [getCalendarDetailsAtOffset]() method.
82+
83+
`date` - returns the date based on the given offset.
84+
`appointments` - returns the appointments based on the given offset.
85+
`targetElement` - returns the calendar element based on the given offset.
86+
`resource` - returns the resource based on the given offset.
87+
88+
{% tabs %}
89+
{% highlight Dart %}
90+
91+
@override
92+
Widget build(BuildContext context) {
93+
return MaterialApp(
94+
home: Scaffold(
95+
body: MouseRegion(
96+
onHover: (PointerHoverEvent event) {
97+
CalendarDetails? details = _calendarController
98+
.getCalendarDetailsAtOffset!(event.localPosition);
99+
if (details!.targetElement == CalendarElement.appointment) {
100+
dynamic appointments = details.appointments;
101+
final String subject =
102+
details.appointments![0].subject.toString();
103+
final dynamic startTime = details.appointments![0].startTime;
104+
final dynamic endTime = details.appointments![0].endTime;
105+
}
106+
},
107+
child: SfCalendar(
108+
view: CalendarView.month,
109+
controller: _calendarController,
110+
dataSource: _getCalendarDataSource(),
111+
))),
112+
);
113+
}
114+
}
115+
116+
{% endhighlight %}
117+
{% endtabs %}
118+
79119
## Long press callback
80120
The [onLongPress](https://pub.dev/documentation/syncfusion_flutter_calendar/latest/calendar/SfCalendar/onLongPress.html) callback is called, whenever the `SfCalendar` elements are long pressed on view.
81121

0 commit comments

Comments
 (0)