Initial commit

This commit is contained in:
kihong.kim
2026-01-24 19:41:19 +09:00
commit 807df3d678
90 changed files with 6411 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
class WeatherInfo {
final String description;
final double temperature;
final String icon;
final String city;
const WeatherInfo({
required this.description,
required this.temperature,
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,
icon: weather["icon"] as String? ?? "",
city: json["name"] as String? ?? "",
);
}
}