Files
bini-google-tv/flutter_app/lib/models/weather_info.dart
kihong.kim e2f00c6e21 feat: Enhance TV support and Daily Weather Forecast (w/ Air Quality)
- **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.
2026-01-31 21:19:13 +09:00

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? ?? "",
);
}
}