Skip to content

Cierra-Runis/qweather_icons

Repository files navigation

qweather_icons

『 qweather_icons - QWeather Icons! 』

中文 Readme

Latest update: 2023-09-21 17:00:44

📚 Introduction

📸 Screenshots

📦 How to use

⏳ Rate of progress

📌 Cautions

🧑‍💻 Contributor

🔦 Declaration


📚 Introduction

An Icon package for QWeather, which helps you show its icon continently.

📸 Screenshots

screenshot_1

screenshot_2

Or try out live example app.

📦 How to use

  1. Add latest version to pubspec.yaml

    dependencies:
      qweather_icons: ^1.6.0
  2. Use it any where

    Icon(QweatherIcons.tag_qweather),
  3. More method

    /// get icon with [tag]
    ///
    /// if it doesn't exist, return [QWeatherIcons.tag_unknown] as default value
    factory QWeatherIcons.getIconWith(String? tag) {
      if (tag == null) return QWeatherIcons.tag_unknown;
      for (QWeatherIcons icons in QWeatherIcons.values) {
        if (icons.tag == tag) return icons;
      }
      return QWeatherIcons.tag_unknown;
    }
    
    /// get filled icon with [qWeatherIcons]
    ///
    /// if it doesn't exist, return [QWeatherIcons.tag_unknown] as default value
    factory QWeatherIcons.getFilledIconWith(QWeatherIcons qWeatherIcons) {
      if (qWeatherIcons.tag.endsWith('_fill')) return qWeatherIcons;
      for (QWeatherIcons icons in QWeatherIcons.values) {
        if ('${qWeatherIcons.tag}_fill' == icons.tag) return icons;
      }
      return QWeatherIcons.tag_unknown;
    }
    
    /// get unfilled icon with [qWeatherIcons]
    ///
    /// if it doesn't exist, return [QWeatherIcons.tag_unknown] as default value
    factory QWeatherIcons.getUnfilledIconWith(QWeatherIcons qWeatherIcons) {
      if (!qWeatherIcons.tag.endsWith('_fill')) return qWeatherIcons;
      for (QWeatherIcons icons in QWeatherIcons.values) {
        if ('${icons.tag}_fill' == qWeatherIcons.tag) return icons;
      }
      return QWeatherIcons.tag_unknown;
    }

⏳ Rate of progress

Done...?

📌 Cautions

  • None

🧑‍💻 Contributor

🔦 Declaration

License

This project is licensed under the terms of the BSD-3-Clause license. See LICENSE for more details

For QWeather_Icons.ttf