项目结构:
- 📁.idea
- 📁android
- 📁ios
- 📁lib
- 📁test_driver
- 📝.flutter-plugins-dependencies
- 📝.gitignore
- 📝.metadata
- 📝README.md
- 📝analysis_options.yaml
- 📝device_calendar_example.iml
- 📝device_calendar_example_android.iml
- 📝pubspec.lock
- 📝pubspec.yaml
Examples
- 📁.idea
- 📁android
- 📁ios
- 📁lib
- 📁test_driver
- 📝.flutter-plugins-dependencies
- 📝.gitignore
- 📝.metadata
- 📝README.md
- 📝analysis_options.yaml
- 📝device_calendar_example.iml
- 📝device_calendar_example_android.iml
- 📝pubspec.lock
- 📝pubspec.yaml
Examples
Most of the APIs are covered in calendar_event.dart or calendar_events.dart files in the example app. You'll be able to get a reference of how the APIs are used.
For a full API reference, the documentation can be found at pub.dev.
DayOfWeekGroup Enum
DayOfWeekGroup
enum allows to explicitly choose and return a list of DayOfWeek
enum values by using an extension getDays
:
-
DayOfWeekGroup.Weekday.getDays
will return: -
DayOfWeekGroup.Weekend.getDays
will return: -
DayOfWeekGroup.Alldays.getDays
will return:
Attendee Examples
Examples below present on how to initialise an Attendee
model in Dart:
-
A required attendee:
-
An optional attendee:
Reminder Examples
Examples below present on how to initialise a Reminder
model in Dart:
-
30 minutes
-
1 day
Recurrence Rule Examples
Examples below present sample parameters of recurrence rules received by each platform and required properties for the RecurrenceRule
model in Dart.
Please note: Receiving monthly and yearly recurrence parameters are slightly different for the two platforms.
You can find more standard examples at iCalendar.org.
Daily Rule
Daily every 5 days and end after 3 occurrences
-
Recurrence parameter example (Android and iOS):
FREQ=DAILY;INTERVAL=5;COUNT=3
-
Dart example:
Weekly Rule
Weekly on Monday, Tuesday and Saturday every 2 weeks and end on 31 Jan 2020
-
Recurrence parameter example (Android and iOS):
FREQ=WEEKLY;BYDAY=MO,TU,SA;INTERVAL=2;UNTIL=20200130T130000Z
-
Dart example:
Monthly/Yearly SetPosition (Week Number) Rule
Monthly on third Thursday
-
Recurrence parameter example (Android):
FREQ=MONTHLY;INTERVAL=1;BYDAY=3TH
-
Recurrence parameter example (iOS):
FREQ=MONTHLY;INTERVAL=1;BYDAY=TH;BYSETPOS=3
-
Dart example:
Monthly on last Thursday
-
Recurrence parameter example (Android and iOS):
FREQ=MONTHLY;INTERVAL=1;BYDAY=-1TH
-
Dart example:
Yearly on third Thursday of January
-
Recurrence parameter example (Android and iOS):
FREQ=YEARLY;INTERVAL=1;BYMONTH=1;BYDAY=3TH
-
Dart example:
Yearly on last Thursday of January
-
Recurrence parameter example (Android and iOS):
FREQ=YEARLY;INTERVAL=1;BYMONTH=1;BYDAY=-1TH
-
Dart example:
Monthly/Yearly By Day of a Month Rule
Monthly on 8th
-
Recurrence parameter example (Android and iOS):
FREQ=YEARLY;INTERVAL=1;BYMONTHDAY=8
-
Dart example:
Yearly on 8th of February
-
Recurrence parameter example (Android):
FREQ=YEARLY;INTERVAL=1;BYMONTHDAY=8;BYMONTH=2
-
Recurrence parameter example (iOS):
FREQ=YEARLY;INTERVAL=1
-
Dart example:
下载地址:微信扫一扫,关注下方【毕业设计组织】公众号,请回复数字”7045“获取下载链接
