cleanup: remove unnecessary method

welcome
98spag 2023-05-30 14:53:02 +02:00
parent 722dff965b
commit 6631c7766a
1 changed files with 1 additions and 9 deletions

View File

@ -82,18 +82,10 @@ class StatisticsService {
Box box = Hive.box(reducedStatisticsBoxName); Box box = Hive.box(reducedStatisticsBoxName);
Iterable<String> keys = newFood.keys; Iterable<String> keys = newFood.keys;
for(int i = 0; i < keys.length;i++){ for(int i = 0; i < keys.length;i++){
addValuesToList(box, keys.elementAt(i), newFood[keys.elementAt(i)] ?? []); box.put(keys.elementAt(i), newFood[keys.elementAt(i)] ?? []);
} }
} }
void addValuesToList(Box box, String key, List<Food> newValues){
List<Food> existingList = castDynamicToListFood(box.get(key));
for(int i = 0; i < newValues.length;i++){
existingList.add(newValues[i]);
}
box.put(key, existingList);
}
getDayAsIntFromTimestamp(int timestamp){ getDayAsIntFromTimestamp(int timestamp){
DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000); DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(timestamp * 1000);
return dateTime.day; return dateTime.day;