Open github-actions[bot] opened 12 months ago
I would like to work on this. Could you assign this to me?
@bibekpanda55 thanks for contributing, assigning to you
Could you describe the issue a bit more please?
besides harvestEvents
we can add another method (ex careEvents
)
a list of CalendarEventData
would be returned as follows (this is just an idea, we can tune later):
So you just want to me to add an extra event where the logic will be the same as the harvestEvents() method?
@bibekpanda55 as a start, yes
Below is the code that I have added to plant_events.dart as asked.Correct me if I am wrong otherwise I will make a PR.
List<CalendarEventData> careEvents() {
List<CalendarEventData> res = [];
for (int i = 0;
i < _plant.plantedDate.getDayDifference(_plant.sproutDate);
i++) {
DateTime date = _plant.plantedDate.add(Duration(days: i));
res.add(CalendarEventData(
title: 'care ${_plant.description.name} - Day $i',
date: date,
endDate: date,
startTime: date,
color: Colors.green,
));
}
return res;
}
hard to read with the current formatting, hint (use `` instead of
to show the code in better formatting)
but seems about right, you can submit the PR
Sorry forgot to do that. Have added that and now you can check the code.
looks good, instead of i++
I would use i+=3
Got it.Have created a PR as per requirement. You can check the same and merge if you don't find any other issues. Thanks for helping out
for example: pruning, trimming, health check ... etc
https://api.github.com/ammaratef45/hydroponics-garden/blob/0ac6306e1e14c8b7435f61e4a7462f1f0e9abe59/lib/model/plant_events.dart#L5