You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As soon as you add or remove events for controller it will automatically update view assigned to that controller. See, [Use of EventController](#use-of-eventcontroller) for more info
98
+
As soon as you add or remove events from the controller, it will automatically update the calendar view assigned to that controller. See, [Use of EventController](#use-of-eventcontroller) for more info
99
+
100
+
4. Use `GlobalKey` to change the page or jump to a specific page or date. See, [Use of GlobalKey](#use-of-globalkey) for more info.
101
+
102
+
## More on the calendar view
103
+
104
+
### Optional configurations/parameters in Calendar view
showLiveTimeLineInAllDays: true, // To display live time line in all pages in week view.
160
+
width: 400, // width of week view.
161
+
minMonth: DateTime(1990),
162
+
maxMonth: DateTime(2050),
163
+
initialMonth: DateTime(2021),
164
+
heightPerMinute: 1, // height occupied by 1 minute time span.
165
+
eventArranger: SideEventArranger(), // To define how simultaneous events will be arranged.
166
+
onEventTap: (events, date) => print(events),
167
+
);
168
+
```
128
169
129
-
### Use of `EventController`
170
+
To see the list of all parameters and detailed description of parameters visit [documentation](https://pub.dev/documentation/calendar_view/latest/calendar_view/calendar_view-library.html).
130
171
131
-
`EventController` is used for adding or removing events from calendar. When we add or remove events from controller, it will automatically update all the view to which this controller is assigned.
172
+
### Use of `EventController`
132
173
133
-
If you are using all three views in your project and want to synchronize events between them, then pass same `controller` object to all views.
174
+
`EventController` is used to add or remove events from the calendar view. When we add or remove events from the controller, it will automatically update all the views to which this controller is assigned.
134
175
135
176
Methods provided by `EventController`
136
177
@@ -143,47 +184,53 @@ Methods provided by `EventController`
143
184
144
185
### Use of `GlobalKey`
145
186
146
-
User needs to define keys to access functionalities like changing a page or jump to a specific page or date.
187
+
User needs to define global keys to access functionalities like changing a page or jump to a specific page or date. Users can also access the `controller` assigned to respected view using the global key.
147
188
148
-
User needs to define `GlobalKey<MonthViewState>`, `GlobalKey<DayViewState>` and `GlobalKey<WeekViewState>` for month view, day view and week view respectively. By assigning these keys to Views you can access methods defined by State class of respected views.
189
+
By assigning global keys to calendar views you can access methods and fields defined by state class of respected views.
149
190
150
191
Methods defined by `MonthViewState` class:
151
192
152
193
| Name | Parameters | Description |
153
194
|------|------------|-------------|
154
195
| nextPage | none | Jumps to next page. |
155
-
| previousPage | none | Jumps to previous page. |
196
+
| previousPage | none | Jumps to the previous page. |
156
197
| jumpToPage | int page | Jumps to page index defined by `page`. |
157
198
| animateToPage | int page | Animate to page index defined by `page`. |
158
-
| jumpToMonth | DateTime month | Jumps to page that has calendar for month defined `month` |
159
-
| animateToMonth | DateTime month | Animate to page that has calendar for month defined by `month` |
199
+
| jumpToMonth | DateTime month | Jumps to the page that has a calendar for month defined by`month`|
200
+
| animateToMonth | DateTime month | Animate to the page that has a calendar for month defined by `month`|
160
201
161
202
Methods defined by `DayViewState` class.
162
203
163
204
| Name | Parameters | Description |
164
205
|------|------------|-------------|
165
206
| nextPage | none | Jumps to next page. |
166
-
| previousPage | none | Jumps to previous page. |
207
+
| previousPage | none | Jumps to the previous page. |
167
208
| jumpToPage | int page | Jumps to page index defined by `page`. |
168
209
| animateToPage | int page | Animate to page index defined by `page`. |
169
-
| jumpToDate | DateTime date | Jumps to page that has calendar for month defined `date` |
170
-
| animateToDate | DateTime date | Animate to page that has calendar for month defined by `date` |
210
+
| jumpToDate | DateTime date | Jumps to the page that has a calendar for month defined by`date`|
211
+
| animateToDate | DateTime date | Animate to the page that has a calendar for month defined by `date`|
171
212
172
213
Methods defined by `WeekViewState` class.
173
214
174
215
| Name | Parameters | Description |
175
216
|------|------------|-------------|
176
217
| nextPage | none | Jumps to next page. |
177
-
| previousPage | none | Jumps to previous page. |
218
+
| previousPage | none | Jumps to the previous page. |
178
219
| jumpToPage | int page | Jumps to page index defined by `page`. |
179
220
| animateToPage | int page | Animate to page index defined by `page`. |
180
-
| jumpToWeek | DateTime week | Jumps to page that has calendar for month defined `week` |
181
-
| animateToWeek | DateTime week | Animate to page that has calendar for month defined by `week` |
221
+
| jumpToWeek | DateTime week | Jumps to the page that has a calendar for month defined by`week`|
222
+
| animateToWeek | DateTime week | Animate to the page that has a calendar for month defined by `week`|
182
223
224
+
### Synchronize events between calendar views
225
+
226
+
There are two ways to synchronize events between calendar views.
227
+
228
+
1. Provide the same `controller` object to all calendar views used in the project.
229
+
2. Wrap MaterialApp with `CalendarControllerProvider` and provide controller as argument as defined in [Implementation](#implementation).
0 commit comments