Skip to content

Commit ffab216

Browse files
committed
Update Weather model
1 parent 6d86245 commit ffab216

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

lib/services/weather.dart

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
class WeatherModel {
2+
String getWeatherIcon(int condition) {
3+
if (condition < 300) {
4+
return '🌩';
5+
} else if (condition < 400) {
6+
return '🌧';
7+
} else if (condition < 600) {
8+
return '☔️';
9+
} else if (condition < 700) {
10+
return '☃️';
11+
} else if (condition < 800) {
12+
return '🌫';
13+
} else if (condition == 800) {
14+
return '☀️';
15+
} else if (condition <= 804) {
16+
return '☁️';
17+
} else {
18+
return '🤷‍';
19+
}
20+
}
21+
22+
String getMessage(int temp) {
23+
if (temp > 25) {
24+
return 'It\'s 🍦 time';
25+
} else if (temp > 20) {
26+
return 'Time for shorts and 👕';
27+
} else if (temp < 10) {
28+
return 'You\'ll need 🧣 and 🧤';
29+
} else {
30+
return 'Bring a 🧥 just in case';
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)