- **Frontend (Flutter)**
- Optimize for Google TV: Force Landscape mode, disable touchscreen requirement, and set TV Dashboard as default home.
- Weather Widget:
- Add Daily Max/Min temperature ('최고/최저').
- Add Air Quality Index (AQI) with visual indicator ('미세먼지').
- Increase font sizes and adjust layout to match Digital Clock style.
- Implement 1-hour auto-refresh timer.
- Model: Update WeatherInfo to support tempMin, tempMax, and aqi.
- **Backend (Node.js)**
- Weather API (/api/weather):
- Implement daily forecast aggregation logic (Seoul Time KST) to calculate accurate daily High/Low.
- Integrate OpenWeatherMap Air Pollution API to fetch AQI.
35 lines
1.0 KiB
Dart
35 lines
1.0 KiB
Dart
class WeatherInfo {
|
|
final String description;
|
|
final double temperature;
|
|
final double tempMin;
|
|
final double tempMax;
|
|
final int aqi;
|
|
final String icon;
|
|
final String city;
|
|
|
|
const WeatherInfo({
|
|
required this.description,
|
|
required this.temperature,
|
|
required this.tempMin,
|
|
required this.tempMax,
|
|
required this.aqi,
|
|
required this.icon,
|
|
required this.city,
|
|
});
|
|
|
|
factory WeatherInfo.fromJson(Map<String, dynamic> json) {
|
|
final weather = (json["weather"] as List<dynamic>? ?? []).isNotEmpty
|
|
? json["weather"][0] as Map<String, dynamic>
|
|
: {};
|
|
return WeatherInfo(
|
|
description: weather["description"] as String? ?? "",
|
|
temperature: (json["main"]?["temp"] as num?)?.toDouble() ?? 0,
|
|
tempMin: (json["main"]?["temp_min"] as num?)?.toDouble() ?? 0,
|
|
tempMax: (json["main"]?["temp_max"] as num?)?.toDouble() ?? 0,
|
|
aqi: json["aqi"] as int? ?? 0,
|
|
icon: weather["icon"] as String? ?? "",
|
|
city: json["name"] as String? ?? "",
|
|
);
|
|
}
|
|
}
|