Initial Commit

This commit is contained in:
Konstantin Kollar
2022-08-29 14:28:17 +02:00
commit e2e6cab479
129 changed files with 4516 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import 'package:wetter/models/hourly_weather_model.dart';
class DailyWeatherModel {
late List<HourlyWeatherModel> hourlyForecasts;
DailyWeatherModel.fromJson(Map<String, dynamic> json) {
List dataPoints = json['weather'];
hourlyForecasts = [];
for (var dataPoint in dataPoints) {
hourlyForecasts.add(HourlyWeatherModel.fromJson(dataPoint));
}
}
String dailyAverageTemp() {
double tempSum = 0;
for (var forecast in hourlyForecasts) {
tempSum = tempSum + forecast.temperature;
}
return (tempSum / hourlyForecasts.length).toString();
}
}