Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions example/lib/presentation/pages/calendar_event.dart
Original file line number Diff line number Diff line change
Expand Up @@ -674,11 +674,11 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
setState(() {
if (value) {
_rrule = _rrule?.copyWith(
byMonthDays: {1}, byWeekDays: {});
byMonthDays: [1], byWeekDays: []);
} else {
_rrule = _rrule?.copyWith(
byMonthDays: {},
byWeekDays: {ByWeekDayEntry(1, 1)});
byMonthDays: [],
byWeekDays: [ByWeekDayEntry(1, 1)]);
}
});
},
Expand All @@ -694,7 +694,7 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
if (value != null) {
setState(() {
_rrule = _rrule
?.copyWith(byMonths: {value.index + 1});
?.copyWith(byMonths: [value.index + 1]);
_getValidDaysOfMonth(_rrule?.frequency);
});
}
Expand Down Expand Up @@ -722,7 +722,7 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
if (value != null) {
setState(() {
_rrule =
_rrule?.copyWith(byMonthDays: {value});
_rrule?.copyWith(byMonthDays: [value]);
});
}
},
Expand Down Expand Up @@ -766,10 +766,10 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
_rrule?.byWeekDays.first.day ?? 1;
setState(() {
_rrule = _rrule?.copyWith(
byWeekDays: {
byWeekDays: [
ByWeekDayEntry(
weekDay, value.index + 1)
});
]);
});
}
},
Expand All @@ -795,10 +795,10 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
1;
setState(() {
_rrule = _rrule?.copyWith(
byWeekDays: {
byWeekDays: [
ByWeekDayEntry(
value.index + 1, weekNo)
});
]);
});
}
},
Expand All @@ -825,7 +825,7 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
if (value != null) {
setState(() {
_rrule = _rrule?.copyWith(
byMonths: {value.index + 1});
byMonths: [value.index + 1]);
});
}
},
Expand Down Expand Up @@ -1068,30 +1068,30 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
void _updateDaysOfWeek() {
switch (_dayOfWeekGroup) {
case DayOfWeekGroup.Weekday:
_rrule = _rrule?.copyWith(byWeekDays: {
_rrule = _rrule?.copyWith(byWeekDays: [
ByWeekDayEntry(1),
ByWeekDayEntry(2),
ByWeekDayEntry(3),
ByWeekDayEntry(4),
ByWeekDayEntry(5),
});
]);
break;
case DayOfWeekGroup.Weekend:
_rrule = _rrule?.copyWith(byWeekDays: {
_rrule = _rrule?.copyWith(byWeekDays: [
ByWeekDayEntry(6),
ByWeekDayEntry(7),
});
]);
break;
case DayOfWeekGroup.AllDays:
_rrule = _rrule?.copyWith(byWeekDays: {
_rrule = _rrule?.copyWith(byWeekDays: [
ByWeekDayEntry(1),
ByWeekDayEntry(2),
ByWeekDayEntry(3),
ByWeekDayEntry(4),
ByWeekDayEntry(5),
ByWeekDayEntry(6),
ByWeekDayEntry(7),
});
]);
break;
case DayOfWeekGroup.None:
default:
Expand Down Expand Up @@ -1138,7 +1138,7 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
}
}

int _weekNumFromWeekDayOccurence(Set<ByWeekDayEntry> weekdays) {
int _weekNumFromWeekDayOccurence(List<ByWeekDayEntry> weekdays) {
final weekNum = weekdays.first.occurrence;
if (weekNum != null) {
return weekNum - 1;
Expand Down Expand Up @@ -1168,7 +1168,7 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
}
if (!hasByWeekDays && !hasByMonthDays) {
_rrule = rrule
.copyWith(frequency: freq, byWeekDays: {ByWeekDayEntry(1, 1)});
.copyWith(frequency: freq, byWeekDays: [ByWeekDayEntry(1, 1)]);
} else {
_rrule = rrule.copyWith(frequency: freq);
}
Expand All @@ -1177,8 +1177,8 @@ class _CalendarEventPageState extends State<CalendarEventPage> {
if (!hasByWeekDays || !hasByMonths) {
_rrule = rrule.copyWith(
frequency: freq,
byWeekDays: {ByWeekDayEntry(1, 1)},
byMonths: {1});
byWeekDays: [ByWeekDayEntry(1, 1)],
byMonths: [1]);
} else {
_rrule = rrule.copyWith(frequency: freq);
}
Expand Down