From 54fa8a2f2fd01ca8399de3742bf802fb00086980 Mon Sep 17 00:00:00 2001 From: ristiisa Date: Sat, 17 Oct 2020 02:56:49 +0300 Subject: [PATCH] fix(codegen): fixed code generation to combat tree shaking error (#12) --- example/lib/util.dart | 2 +- lib/src/weather_icons_g.dart | 462 ++++++++++++++++----------------- test/weather_icons_g_test.dart | 2 +- tool/scrape_icons | 6 +- 4 files changed, 236 insertions(+), 236 deletions(-) diff --git a/example/lib/util.dart b/example/lib/util.dart index 150d330..089eddc 100644 --- a/example/lib/util.dart +++ b/example/lib/util.dart @@ -1,5 +1,5 @@ class WeatherIconsUtil { - static const int dateTimestamp = 1563582063844; + static const int dateTimestamp = 1601885646647; static const Map iconMap = { 'wi-day-sunny': 0xf00d, diff --git a/lib/src/weather_icons_g.dart b/lib/src/weather_icons_g.dart index aee3edc..bbc6233 100644 --- a/lib/src/weather_icons_g.dart +++ b/lib/src/weather_icons_g.dart @@ -1,7 +1,7 @@ /// GENERATED CODE /// This file is auto-generated by the 'scrape_icons' script, and should not be modified by hand. /// See the README.md for more information. -/// Generated on Fri Jul 19 2019 20:21:03 GMT-0400 (Eastern Daylight Time) +/// Generated on Mon Oct 05 2020 11:14:06 GMT+0300 (Eastern European Summer Time) import 'package:flutter/material.dart'; @@ -728,237 +728,237 @@ class WeatherIcons { throw UnsupportedError('Unsupported icon $name, with no fallback'); } - return exists ? WIData(_all[target]) : fallback; + return exists ? _all[target] : fallback; } - static const Map _all = { - 'wi-day-sunny': 0xf00d, - 'wi-day-cloudy': 0xf002, - 'wi-day-cloudy-gusts': 0xf000, - 'wi-day-cloudy-windy': 0xf001, - 'wi-day-fog': 0xf003, - 'wi-day-hail': 0xf004, - 'wi-day-haze': 0xf0b6, - 'wi-day-lightning': 0xf005, - 'wi-day-rain': 0xf008, - 'wi-day-rain-mix': 0xf006, - 'wi-day-rain-wind': 0xf007, - 'wi-day-showers': 0xf009, - 'wi-day-sleet': 0xf0b2, - 'wi-day-sleet-storm': 0xf068, - 'wi-day-snow': 0xf00a, - 'wi-day-snow-thunderstorm': 0xf06b, - 'wi-day-snow-wind': 0xf065, - 'wi-day-sprinkle': 0xf00b, - 'wi-day-storm-showers': 0xf00e, - 'wi-day-sunny-overcast': 0xf00c, - 'wi-day-thunderstorm': 0xf010, - 'wi-day-windy': 0xf085, - 'wi-solar-eclipse': 0xf06e, - 'wi-hot': 0xf072, - 'wi-day-cloudy-high': 0xf07d, - 'wi-day-light-wind': 0xf0c4, - 'wi-night-clear': 0xf02e, - 'wi-night-alt-cloudy': 0xf086, - 'wi-night-alt-cloudy-gusts': 0xf022, - 'wi-night-alt-cloudy-windy': 0xf023, - 'wi-night-alt-hail': 0xf024, - 'wi-night-alt-lightning': 0xf025, - 'wi-night-alt-rain': 0xf028, - 'wi-night-alt-rain-mix': 0xf026, - 'wi-night-alt-rain-wind': 0xf027, - 'wi-night-alt-showers': 0xf029, - 'wi-night-alt-sleet': 0xf0b4, - 'wi-night-alt-sleet-storm': 0xf06a, - 'wi-night-alt-snow': 0xf02a, - 'wi-night-alt-snow-thunderstorm': 0xf06d, - 'wi-night-alt-snow-wind': 0xf067, - 'wi-night-alt-sprinkle': 0xf02b, - 'wi-night-alt-storm-showers': 0xf02c, - 'wi-night-alt-thunderstorm': 0xf02d, - 'wi-night-cloudy': 0xf031, - 'wi-night-cloudy-gusts': 0xf02f, - 'wi-night-cloudy-windy': 0xf030, - 'wi-night-fog': 0xf04a, - 'wi-night-hail': 0xf032, - 'wi-night-lightning': 0xf033, - 'wi-night-partly-cloudy': 0xf083, - 'wi-night-rain': 0xf036, - 'wi-night-rain-mix': 0xf034, - 'wi-night-rain-wind': 0xf035, - 'wi-night-showers': 0xf037, - 'wi-night-sleet': 0xf0b3, - 'wi-night-sleet-storm': 0xf069, - 'wi-night-snow': 0xf038, - 'wi-night-snow-thunderstorm': 0xf06c, - 'wi-night-snow-wind': 0xf066, - 'wi-night-sprinkle': 0xf039, - 'wi-night-storm-showers': 0xf03a, - 'wi-night-thunderstorm': 0xf03b, - 'wi-lunar-eclipse': 0xf070, - 'wi-stars': 0xf077, - 'wi-storm-showers': 0xf01d, - 'wi-thunderstorm': 0xf01e, - 'wi-night-alt-cloudy-high': 0xf07e, - 'wi-night-cloudy-high': 0xf080, - 'wi-night-alt-partly-cloudy': 0xf081, - 'wi-cloud': 0xf041, - 'wi-cloudy': 0xf013, - 'wi-cloudy-gusts': 0xf011, - 'wi-cloudy-windy': 0xf012, - 'wi-fog': 0xf014, - 'wi-hail': 0xf015, - 'wi-rain': 0xf019, - 'wi-rain-mix': 0xf017, - 'wi-rain-wind': 0xf018, - 'wi-showers': 0xf01a, - 'wi-sleet': 0xf0b5, - 'wi-snow': 0xf01b, - 'wi-sprinkle': 0xf01c, - 'wi-snow-wind': 0xf064, - 'wi-smog': 0xf074, - 'wi-smoke': 0xf062, - 'wi-lightning': 0xf016, - 'wi-raindrops': 0xf04e, - 'wi-raindrop': 0xf078, - 'wi-dust': 0xf063, - 'wi-snowflake-cold': 0xf076, - 'wi-windy': 0xf021, - 'wi-strong-wind': 0xf050, - 'wi-sandstorm': 0xf082, - 'wi-earthquake': 0xf0c6, - 'wi-fire': 0xf0c7, - 'wi-flood': 0xf07c, - 'wi-meteor': 0xf071, - 'wi-tsunami': 0xf0c5, - 'wi-volcano': 0xf0c8, - 'wi-hurricane': 0xf073, - 'wi-tornado': 0xf056, - 'wi-small-craft-advisory': 0xf0cc, - 'wi-gale-warning': 0xf0cd, - 'wi-storm-warning': 0xf0ce, - 'wi-hurricane-warning': 0xf0cf, - 'wi-wind-direction': 0xf0b1, - 'wi-alien': 0xf075, - 'wi-celsius': 0xf03c, - 'wi-fahrenheit': 0xf045, - 'wi-degrees': 0xf042, - 'wi-thermometer': 0xf055, - 'wi-thermometer-exterior': 0xf053, - 'wi-thermometer-internal': 0xf054, - 'wi-cloud-down': 0xf03d, - 'wi-cloud-up': 0xf040, - 'wi-cloud-refresh': 0xf03e, - 'wi-horizon': 0xf047, - 'wi-horizon-alt': 0xf046, - 'wi-sunrise': 0xf051, - 'wi-sunset': 0xf052, - 'wi-moonrise': 0xf0c9, - 'wi-moonset': 0xf0ca, - 'wi-refresh': 0xf04c, - 'wi-refresh-alt': 0xf04b, - 'wi-umbrella': 0xf084, - 'wi-barometer': 0xf079, - 'wi-humidity': 0xf07a, - 'wi-na': 0xf07b, - 'wi-train': 0xf0cb, - 'wi-moon-new': 0xf095, - 'wi-moon-waxing-crescent-1': 0xf096, - 'wi-moon-waxing-crescent-2': 0xf097, - 'wi-moon-waxing-crescent-3': 0xf098, - 'wi-moon-waxing-crescent-4': 0xf099, - 'wi-moon-waxing-crescent-5': 0xf09a, - 'wi-moon-waxing-crescent-6': 0xf09b, - 'wi-moon-first-quarter': 0xf09c, - 'wi-moon-waxing-gibbous-1': 0xf09d, - 'wi-moon-waxing-gibbous-2': 0xf09e, - 'wi-moon-waxing-gibbous-3': 0xf09f, - 'wi-moon-waxing-gibbous-4': 0xf0a0, - 'wi-moon-waxing-gibbous-5': 0xf0a1, - 'wi-moon-waxing-gibbous-6': 0xf0a2, - 'wi-moon-full': 0xf0a3, - 'wi-moon-waning-gibbous-1': 0xf0a4, - 'wi-moon-waning-gibbous-2': 0xf0a5, - 'wi-moon-waning-gibbous-3': 0xf0a6, - 'wi-moon-waning-gibbous-4': 0xf0a7, - 'wi-moon-waning-gibbous-5': 0xf0a8, - 'wi-moon-waning-gibbous-6': 0xf0a9, - 'wi-moon-third-quarter': 0xf0aa, - 'wi-moon-waning-crescent-1': 0xf0ab, - 'wi-moon-waning-crescent-2': 0xf0ac, - 'wi-moon-waning-crescent-3': 0xf0ad, - 'wi-moon-waning-crescent-4': 0xf0ae, - 'wi-moon-waning-crescent-5': 0xf0af, - 'wi-moon-waning-crescent-6': 0xf0b0, - 'wi-moon-alt-new': 0xf0eb, - 'wi-moon-alt-waxing-crescent-1': 0xf0d0, - 'wi-moon-alt-waxing-crescent-2': 0xf0d1, - 'wi-moon-alt-waxing-crescent-3': 0xf0d2, - 'wi-moon-alt-waxing-crescent-4': 0xf0d3, - 'wi-moon-alt-waxing-crescent-5': 0xf0d4, - 'wi-moon-alt-waxing-crescent-6': 0xf0d5, - 'wi-moon-alt-first-quarter': 0xf0d6, - 'wi-moon-alt-waxing-gibbous-1': 0xf0d7, - 'wi-moon-alt-waxing-gibbous-2': 0xf0d8, - 'wi-moon-alt-waxing-gibbous-3': 0xf0d9, - 'wi-moon-alt-waxing-gibbous-4': 0xf0da, - 'wi-moon-alt-waxing-gibbous-5': 0xf0db, - 'wi-moon-alt-waxing-gibbous-6': 0xf0dc, - 'wi-moon-alt-full': 0xf0dd, - 'wi-moon-alt-waning-gibbous-1': 0xf0de, - 'wi-moon-alt-waning-gibbous-2': 0xf0df, - 'wi-moon-alt-waning-gibbous-3': 0xf0e0, - 'wi-moon-alt-waning-gibbous-4': 0xf0e1, - 'wi-moon-alt-waning-gibbous-5': 0xf0e2, - 'wi-moon-alt-waning-gibbous-6': 0xf0e3, - 'wi-moon-alt-third-quarter': 0xf0e4, - 'wi-moon-alt-waning-crescent-1': 0xf0e5, - 'wi-moon-alt-waning-crescent-2': 0xf0e6, - 'wi-moon-alt-waning-crescent-3': 0xf0e7, - 'wi-moon-alt-waning-crescent-4': 0xf0e8, - 'wi-moon-alt-waning-crescent-5': 0xf0e9, - 'wi-moon-alt-waning-crescent-6': 0xf0ea, - 'wi-time-1': 0xf08a, - 'wi-time-2': 0xf08b, - 'wi-time-3': 0xf08c, - 'wi-time-4': 0xf08d, - 'wi-time-5': 0xf08e, - 'wi-time-6': 0xf08f, - 'wi-time-7': 0xf090, - 'wi-time-8': 0xf091, - 'wi-time-9': 0xf092, - 'wi-time-10': 0xf093, - 'wi-time-11': 0xf094, - 'wi-time-12': 0xf089, - 'wi-direction-up': 0xf058, - 'wi-direction-up-right': 0xf057, - 'wi-direction-right': 0xf04d, - 'wi-direction-down-right': 0xf088, - 'wi-direction-down': 0xf044, - 'wi-direction-down-left': 0xf043, - 'wi-direction-left': 0xf048, - 'wi-direction-up-left': 0xf087, - 'wi-wind-beaufort-0': 0xf0b7, - 'wi-wind-beaufort-1': 0xf0b8, - 'wi-wind-beaufort-2': 0xf0b9, - 'wi-wind-beaufort-3': 0xf0ba, - 'wi-wind-beaufort-4': 0xf0bb, - 'wi-wind-beaufort-5': 0xf0bc, - 'wi-wind-beaufort-6': 0xf0bd, - 'wi-wind-beaufort-7': 0xf0be, - 'wi-wind-beaufort-8': 0xf0bf, - 'wi-wind-beaufort-9': 0xf0c0, - 'wi-wind-beaufort-10': 0xf0c1, - 'wi-wind-beaufort-11': 0xf0c2, - 'wi-wind-beaufort-12': 0xf0c3, - 'wind': 0xf0b1, - 'wind-deg-0': 0xf05c, - 'wind-deg-45': 0xf05a, - 'wind-deg-90': 0xf059, - 'wind-deg-135': 0xf05d, - 'wind-deg-180': 0xf060, - 'wind-deg-225': 0xf05e, - 'wind-deg-270': 0xf061, - 'wind-deg-315': 0xf05b, + static const Map _all = { + 'wi-day-sunny': day_sunny, + 'wi-day-cloudy': day_cloudy, + 'wi-day-cloudy-gusts': day_cloudy_gusts, + 'wi-day-cloudy-windy': day_cloudy_windy, + 'wi-day-fog': day_fog, + 'wi-day-hail': day_hail, + 'wi-day-haze': day_haze, + 'wi-day-lightning': day_lightning, + 'wi-day-rain': day_rain, + 'wi-day-rain-mix': day_rain_mix, + 'wi-day-rain-wind': day_rain_wind, + 'wi-day-showers': day_showers, + 'wi-day-sleet': day_sleet, + 'wi-day-sleet-storm': day_sleet_storm, + 'wi-day-snow': day_snow, + 'wi-day-snow-thunderstorm': day_snow_thunderstorm, + 'wi-day-snow-wind': day_snow_wind, + 'wi-day-sprinkle': day_sprinkle, + 'wi-day-storm-showers': day_storm_showers, + 'wi-day-sunny-overcast': day_sunny_overcast, + 'wi-day-thunderstorm': day_thunderstorm, + 'wi-day-windy': day_windy, + 'wi-solar-eclipse': solar_eclipse, + 'wi-hot': hot, + 'wi-day-cloudy-high': day_cloudy_high, + 'wi-day-light-wind': day_light_wind, + 'wi-night-clear': night_clear, + 'wi-night-alt-cloudy': night_alt_cloudy, + 'wi-night-alt-cloudy-gusts': night_alt_cloudy_gusts, + 'wi-night-alt-cloudy-windy': night_alt_cloudy_windy, + 'wi-night-alt-hail': night_alt_hail, + 'wi-night-alt-lightning': night_alt_lightning, + 'wi-night-alt-rain': night_alt_rain, + 'wi-night-alt-rain-mix': night_alt_rain_mix, + 'wi-night-alt-rain-wind': night_alt_rain_wind, + 'wi-night-alt-showers': night_alt_showers, + 'wi-night-alt-sleet': night_alt_sleet, + 'wi-night-alt-sleet-storm': night_alt_sleet_storm, + 'wi-night-alt-snow': night_alt_snow, + 'wi-night-alt-snow-thunderstorm': night_alt_snow_thunderstorm, + 'wi-night-alt-snow-wind': night_alt_snow_wind, + 'wi-night-alt-sprinkle': night_alt_sprinkle, + 'wi-night-alt-storm-showers': night_alt_storm_showers, + 'wi-night-alt-thunderstorm': night_alt_thunderstorm, + 'wi-night-cloudy': night_cloudy, + 'wi-night-cloudy-gusts': night_cloudy_gusts, + 'wi-night-cloudy-windy': night_cloudy_windy, + 'wi-night-fog': night_fog, + 'wi-night-hail': night_hail, + 'wi-night-lightning': night_lightning, + 'wi-night-partly-cloudy': night_partly_cloudy, + 'wi-night-rain': night_rain, + 'wi-night-rain-mix': night_rain_mix, + 'wi-night-rain-wind': night_rain_wind, + 'wi-night-showers': night_showers, + 'wi-night-sleet': night_sleet, + 'wi-night-sleet-storm': night_sleet_storm, + 'wi-night-snow': night_snow, + 'wi-night-snow-thunderstorm': night_snow_thunderstorm, + 'wi-night-snow-wind': night_snow_wind, + 'wi-night-sprinkle': night_sprinkle, + 'wi-night-storm-showers': night_storm_showers, + 'wi-night-thunderstorm': night_thunderstorm, + 'wi-lunar-eclipse': lunar_eclipse, + 'wi-stars': stars, + 'wi-storm-showers': storm_showers, + 'wi-thunderstorm': thunderstorm, + 'wi-night-alt-cloudy-high': night_alt_cloudy_high, + 'wi-night-cloudy-high': night_cloudy_high, + 'wi-night-alt-partly-cloudy': night_alt_partly_cloudy, + 'wi-cloud': cloud, + 'wi-cloudy': cloudy, + 'wi-cloudy-gusts': cloudy_gusts, + 'wi-cloudy-windy': cloudy_windy, + 'wi-fog': fog, + 'wi-hail': hail, + 'wi-rain': rain, + 'wi-rain-mix': rain_mix, + 'wi-rain-wind': rain_wind, + 'wi-showers': showers, + 'wi-sleet': sleet, + 'wi-snow': snow, + 'wi-sprinkle': sprinkle, + 'wi-snow-wind': snow_wind, + 'wi-smog': smog, + 'wi-smoke': smoke, + 'wi-lightning': lightning, + 'wi-raindrops': raindrops, + 'wi-raindrop': raindrop, + 'wi-dust': dust, + 'wi-snowflake-cold': snowflake_cold, + 'wi-windy': windy, + 'wi-strong-wind': strong_wind, + 'wi-sandstorm': sandstorm, + 'wi-earthquake': earthquake, + 'wi-fire': fire, + 'wi-flood': flood, + 'wi-meteor': meteor, + 'wi-tsunami': tsunami, + 'wi-volcano': volcano, + 'wi-hurricane': hurricane, + 'wi-tornado': tornado, + 'wi-small-craft-advisory': small_craft_advisory, + 'wi-gale-warning': gale_warning, + 'wi-storm-warning': storm_warning, + 'wi-hurricane-warning': hurricane_warning, + 'wi-wind-direction': wind_direction, + 'wi-alien': alien, + 'wi-celsius': celsius, + 'wi-fahrenheit': fahrenheit, + 'wi-degrees': degrees, + 'wi-thermometer': thermometer, + 'wi-thermometer-exterior': thermometer_exterior, + 'wi-thermometer-internal': thermometer_internal, + 'wi-cloud-down': cloud_down, + 'wi-cloud-up': cloud_up, + 'wi-cloud-refresh': cloud_refresh, + 'wi-horizon': horizon, + 'wi-horizon-alt': horizon_alt, + 'wi-sunrise': sunrise, + 'wi-sunset': sunset, + 'wi-moonrise': moonrise, + 'wi-moonset': moonset, + 'wi-refresh': refresh, + 'wi-refresh-alt': refresh_alt, + 'wi-umbrella': umbrella, + 'wi-barometer': barometer, + 'wi-humidity': humidity, + 'wi-na': na, + 'wi-train': train, + 'wi-moon-new': moon_new, + 'wi-moon-waxing-crescent-1': moon_waxing_crescent_1, + 'wi-moon-waxing-crescent-2': moon_waxing_crescent_2, + 'wi-moon-waxing-crescent-3': moon_waxing_crescent_3, + 'wi-moon-waxing-crescent-4': moon_waxing_crescent_4, + 'wi-moon-waxing-crescent-5': moon_waxing_crescent_5, + 'wi-moon-waxing-crescent-6': moon_waxing_crescent_6, + 'wi-moon-first-quarter': moon_first_quarter, + 'wi-moon-waxing-gibbous-1': moon_waxing_gibbous_1, + 'wi-moon-waxing-gibbous-2': moon_waxing_gibbous_2, + 'wi-moon-waxing-gibbous-3': moon_waxing_gibbous_3, + 'wi-moon-waxing-gibbous-4': moon_waxing_gibbous_4, + 'wi-moon-waxing-gibbous-5': moon_waxing_gibbous_5, + 'wi-moon-waxing-gibbous-6': moon_waxing_gibbous_6, + 'wi-moon-full': moon_full, + 'wi-moon-waning-gibbous-1': moon_waning_gibbous_1, + 'wi-moon-waning-gibbous-2': moon_waning_gibbous_2, + 'wi-moon-waning-gibbous-3': moon_waning_gibbous_3, + 'wi-moon-waning-gibbous-4': moon_waning_gibbous_4, + 'wi-moon-waning-gibbous-5': moon_waning_gibbous_5, + 'wi-moon-waning-gibbous-6': moon_waning_gibbous_6, + 'wi-moon-third-quarter': moon_third_quarter, + 'wi-moon-waning-crescent-1': moon_waning_crescent_1, + 'wi-moon-waning-crescent-2': moon_waning_crescent_2, + 'wi-moon-waning-crescent-3': moon_waning_crescent_3, + 'wi-moon-waning-crescent-4': moon_waning_crescent_4, + 'wi-moon-waning-crescent-5': moon_waning_crescent_5, + 'wi-moon-waning-crescent-6': moon_waning_crescent_6, + 'wi-moon-alt-new': moon_alt_new, + 'wi-moon-alt-waxing-crescent-1': moon_alt_waxing_crescent_1, + 'wi-moon-alt-waxing-crescent-2': moon_alt_waxing_crescent_2, + 'wi-moon-alt-waxing-crescent-3': moon_alt_waxing_crescent_3, + 'wi-moon-alt-waxing-crescent-4': moon_alt_waxing_crescent_4, + 'wi-moon-alt-waxing-crescent-5': moon_alt_waxing_crescent_5, + 'wi-moon-alt-waxing-crescent-6': moon_alt_waxing_crescent_6, + 'wi-moon-alt-first-quarter': moon_alt_first_quarter, + 'wi-moon-alt-waxing-gibbous-1': moon_alt_waxing_gibbous_1, + 'wi-moon-alt-waxing-gibbous-2': moon_alt_waxing_gibbous_2, + 'wi-moon-alt-waxing-gibbous-3': moon_alt_waxing_gibbous_3, + 'wi-moon-alt-waxing-gibbous-4': moon_alt_waxing_gibbous_4, + 'wi-moon-alt-waxing-gibbous-5': moon_alt_waxing_gibbous_5, + 'wi-moon-alt-waxing-gibbous-6': moon_alt_waxing_gibbous_6, + 'wi-moon-alt-full': moon_alt_full, + 'wi-moon-alt-waning-gibbous-1': moon_alt_waning_gibbous_1, + 'wi-moon-alt-waning-gibbous-2': moon_alt_waning_gibbous_2, + 'wi-moon-alt-waning-gibbous-3': moon_alt_waning_gibbous_3, + 'wi-moon-alt-waning-gibbous-4': moon_alt_waning_gibbous_4, + 'wi-moon-alt-waning-gibbous-5': moon_alt_waning_gibbous_5, + 'wi-moon-alt-waning-gibbous-6': moon_alt_waning_gibbous_6, + 'wi-moon-alt-third-quarter': moon_alt_third_quarter, + 'wi-moon-alt-waning-crescent-1': moon_alt_waning_crescent_1, + 'wi-moon-alt-waning-crescent-2': moon_alt_waning_crescent_2, + 'wi-moon-alt-waning-crescent-3': moon_alt_waning_crescent_3, + 'wi-moon-alt-waning-crescent-4': moon_alt_waning_crescent_4, + 'wi-moon-alt-waning-crescent-5': moon_alt_waning_crescent_5, + 'wi-moon-alt-waning-crescent-6': moon_alt_waning_crescent_6, + 'wi-time-1': time_1, + 'wi-time-2': time_2, + 'wi-time-3': time_3, + 'wi-time-4': time_4, + 'wi-time-5': time_5, + 'wi-time-6': time_6, + 'wi-time-7': time_7, + 'wi-time-8': time_8, + 'wi-time-9': time_9, + 'wi-time-10': time_10, + 'wi-time-11': time_11, + 'wi-time-12': time_12, + 'wi-direction-up': direction_up, + 'wi-direction-up-right': direction_up_right, + 'wi-direction-right': direction_right, + 'wi-direction-down-right': direction_down_right, + 'wi-direction-down': direction_down, + 'wi-direction-down-left': direction_down_left, + 'wi-direction-left': direction_left, + 'wi-direction-up-left': direction_up_left, + 'wi-wind-beaufort-0': wind_beaufort_0, + 'wi-wind-beaufort-1': wind_beaufort_1, + 'wi-wind-beaufort-2': wind_beaufort_2, + 'wi-wind-beaufort-3': wind_beaufort_3, + 'wi-wind-beaufort-4': wind_beaufort_4, + 'wi-wind-beaufort-5': wind_beaufort_5, + 'wi-wind-beaufort-6': wind_beaufort_6, + 'wi-wind-beaufort-7': wind_beaufort_7, + 'wi-wind-beaufort-8': wind_beaufort_8, + 'wi-wind-beaufort-9': wind_beaufort_9, + 'wi-wind-beaufort-10': wind_beaufort_10, + 'wi-wind-beaufort-11': wind_beaufort_11, + 'wi-wind-beaufort-12': wind_beaufort_12, + 'wind': wind, + 'wind-deg-0': wind_deg_0, + 'wind-deg-45': wind_deg_45, + 'wind-deg-90': wind_deg_90, + 'wind-deg-135': wind_deg_135, + 'wind-deg-180': wind_deg_180, + 'wind-deg-225': wind_deg_225, + 'wind-deg-270': wind_deg_270, + 'wind-deg-315': wind_deg_315, }; } diff --git a/test/weather_icons_g_test.dart b/test/weather_icons_g_test.dart index 03c99f3..fb214b3 100644 --- a/test/weather_icons_g_test.dart +++ b/test/weather_icons_g_test.dart @@ -1,7 +1,7 @@ /// GENERATED CODE /// This file is auto-generated by the 'scrape_icons' script, and should not be modified by hand. /// See the README.md for more information. -/// Generated on Fri Jul 19 2019 20:21:03 GMT-0400 (Eastern Daylight Time) +/// Generated on Mon Oct 05 2020 11:14:06 GMT+0300 (Eastern European Summer Time) import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; diff --git a/tool/scrape_icons b/tool/scrape_icons index 5b39f8d..6601058 100755 --- a/tool/scrape_icons +++ b/tool/scrape_icons @@ -158,7 +158,7 @@ function genHeader(date) { function generateDartFile(iconData, date) { const icons = iconData.map(({ title, code }) => generateIcon(title, code)) - const iconMap = iconData.map(({ title, code }) => `'${title}': 0x${code},`) + const iconMap = iconData.map(({ title, code }) => `'${title}': ${title.replace('wi-', '').replace(/-/g, '_')},`) return ` ${genHeader(date)} @@ -204,10 +204,10 @@ class WeatherIcons { throw UnsupportedError('Unsupported icon $name, with no fallback'); } - return exists ? WIData(_all[target]) : fallback; + return exists ? _all[target] : fallback; } - static const Map _all = { + static const Map _all = { ${iconMap.join('\n ')} }; }