-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚀 Added support for multiple day events #17
🚀 Added support for multiple day events #17
Conversation
cacd42b
to
b72e7db
Compare
CHANGELOG.md
Outdated
@@ -1,3 +1,7 @@ | |||
# 0.0.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please make this tag as unreleased
lib/src/event_controller.dart
Outdated
if (_events[i].addEvent(event)) { | ||
_eventList.add(event); | ||
assert(event.endDate.difference(event.date).inDays >= 0, | ||
'End date must be greater or equal to start date'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grammar mistake : The end date must be greater or equal to the start date
lib/src/event_controller.dart
Outdated
_rangingEventList.add(event); | ||
_eventList.add(event); | ||
} else { | ||
for (var i = 0; i < _events.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use for in loop here?
lib/src/event_controller.dart
Outdated
_eventList.add(event); | ||
} else { | ||
for (var i = 0; i < _events.length; i++) { | ||
if (_events[i].year == event.date.year) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two if condition can be handled with && operator.
lib/src/event_controller.dart
Outdated
@@ -103,6 +113,37 @@ class EventController<T> extends ChangeNotifier { | |||
} | |||
} | |||
|
|||
for (var i = 0; i < _rangingEventList.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use for in loop here ?
lib/src/event_controller.dart
Outdated
@@ -103,6 +113,37 @@ class EventController<T> extends ChangeNotifier { | |||
} | |||
} | |||
|
|||
for (var i = 0; i < _rangingEventList.length; i++) { | |||
final days = <DateTime>[]; | |||
for (var d = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use for in loop here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable names in not proper
lib/src/event_controller.dart
Outdated
.difference(_rangingEventList[i].date) | ||
.inDays; | ||
k++) { | ||
if (days[k].year == date.year) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multiple if conditions can be handled with && operator
lib/src/event_controller.dart
Outdated
} | ||
|
||
if (_rangingEventList[i].date.isBefore(_rangingEventList[i].endDate)) { | ||
for (var k = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use for in loop here ?
5d285bc
to
758d114
Compare
README.md
Outdated
event: "Event 1", | ||
); | ||
|
||
CalendarControllerProvider.of(context).controller.remove(event); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be add now remove.
758d114
to
6466ec0
Compare
6466ec0
to
c790965
Compare
CHANGELOG.md
Outdated
@@ -1,3 +1,7 @@ | |||
# unreleased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be like # [0.0.3] - October 11, 2021 [Unreleased]
lib/src/event_controller.dart
Outdated
if (_events[i].year == event.date.year) { | ||
if (_events[i].addEvent(event)) { | ||
assert(event.endDate.difference(event.date).inDays >= 0, | ||
'The end date must be greater or equal to start date'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The end date must be greater or equal to the
start date
No description provided.