show daily weather at different times, use weather icons, get prevalent weather icon for the day
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:weather_icons/weather_icons.dart';
|
||||
|
||||
IconData weatherIcon(String icon) {
|
||||
switch (icon) {
|
||||
case "clear-day":
|
||||
return WeatherIcons.day_sunny;
|
||||
case "clear-night":
|
||||
return WeatherIcons.night_clear;
|
||||
case "partly-cloudy-day":
|
||||
return WeatherIcons.day_sunny_overcast;
|
||||
case "partly-cloudy-night":
|
||||
return WeatherIcons.night_partly_cloudy;
|
||||
case "cloudy":
|
||||
return WeatherIcons.cloudy;
|
||||
case "fog":
|
||||
return WeatherIcons.fog;
|
||||
case "wind":
|
||||
return WeatherIcons.day_windy;
|
||||
case "rain":
|
||||
return WeatherIcons.day_rain;
|
||||
case "sleet":
|
||||
return WeatherIcons.day_sleet;
|
||||
case "snow":
|
||||
return WeatherIcons.day_snow;
|
||||
case "hail":
|
||||
return WeatherIcons.day_hail;
|
||||
case "thunderstorm":
|
||||
return WeatherIcons.day_thunderstorm;
|
||||
default:
|
||||
return WeatherIcons.alien;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user