40 lines
1.1 KiB
Dart
40 lines
1.1 KiB
Dart
class HourlyWeatherModel {
|
|
late DateTime timestamp;
|
|
String? sourceId;
|
|
double? precipitation;
|
|
double? pressure;
|
|
int? sunshine;
|
|
late double temperature;
|
|
int? windDirection;
|
|
double? windSpeed;
|
|
int? cloudCover;
|
|
double? dewPoint;
|
|
int? relativeHumidity;
|
|
int? visibility;
|
|
int? windGustDirection;
|
|
double? windGustSpeed;
|
|
String? condition;
|
|
String? icon;
|
|
|
|
HourlyWeatherModel();
|
|
|
|
HourlyWeatherModel.fromJson(Map<String, dynamic> json) {
|
|
sourceId = json['source_id'].toString();
|
|
precipitation = json['precipitation'];
|
|
pressure = json['pressure_msl'];
|
|
sunshine = json['sundshine'];
|
|
temperature = json['temperature'];
|
|
windDirection = json['wind_direction'];
|
|
windSpeed = json['wind_speed'];
|
|
cloudCover = json['cloud_cover'];
|
|
dewPoint = json['dew_point'];
|
|
relativeHumidity = json['relative_humidity'];
|
|
visibility = json['visibility'];
|
|
windGustDirection = json['wind_gust_direction'];
|
|
windGustSpeed = json['wind_gust_speed'];
|
|
condition = json['condition'];
|
|
icon = json['icon'];
|
|
timestamp = DateTime.parse(json['timestamp']);
|
|
}
|
|
}
|