搜尋套件、儲存庫與 APP 分類

套件詳情v3.1.0

flutter_weather_bg

提供多種天氣背景動畫效果,涵蓋15種天氣類型,包括晴天、雨天、雪天等...

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
128
喜歡數
58
Pub 分數
155

安裝套件

flutter pub add flutter_weather_bg

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

flutter_weather_bg 是一個 Flutter 套件,為應用程式提供動態天氣主題背景動畫,支援 15 種天氣類型,例如晴天、雨天和雪天。它使用動畫漸變和著色器創造沉浸式視覺效果,在各個平台上提升使用者體驗。該套件透過簡單的新增指令即可無縫整合至 Flutter 專案中,非常適合天氣應用、儀表板或任何尋求氛圍視覺效果的應用。其跨平台支援確保在 Android、iOS、Web、macOS、Windows 和 Linux 上保持一致的效能。

適用情境

  • 天氣應用
  • 互動式儀表板
  • 應用入門螢幕
  • 主題化UI元素
  • 數位看板

主要特色

  • 15 種天氣類型動畫
  • 基於著色器的視覺效果
  • 跨平台相容性
  • 透過 pub 實現輕鬆整合
  • 可自定義的天氣過渡
  • 跨裝置的順暢效能

適合對象

  • 開發天氣應用的開發者
  • 尋求氛圍背景的設計人員
  • 需要動態UI元素的應用程式
  • 跨平台行動與Web專案
  • 創意UI實驗

使用建議

  • 可能影響低階裝置的效能
  • 需要理解 Flutter 渲染機制
  • 超出天氣類型的自訂功能有限
  • 最佳搭配最少的前景內容使用
  • 不適用於靜態背景需求

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_weather_bg

Pub Version Pub Likes License: MIT Platform

A rich and cool weather dynamic background plug-in, supporting 15 weather types.

中文文档

Used by SimplicityWeather to render weather backgrounds. If you want to try the app directly, download the APK here.

Features

  • 15 weather types: sunny, sunny night, cloudy, cloudy night, overcast, light/middle/heavy rain, light/middle/heavy snow, foggy, hazy, dusty and thunder
  • Dynamic width/height — the scene adapts automatically
  • Smooth cross-fade transition when the weather type changes
  • Pure Dart implementation (no native code); renders with CustomPainter on Flutter canvas

Supported platforms

Platform Status
Android ✅
iOS ✅
Web ✅
macOS ✅
Windows Not tested
Linux Not tested

Requirements

  • Flutter >= 3.0.0
  • Dart SDK >= 3.0.0 < 4.0.0 (null-safety)

Installation

Available on pub.dev. Add the dependency to your pubspec.yaml:

dependencies:
  flutter_weather_bg: ^3.1.0

Then run:

flutter pub get

And import it wherever you need:

import 'package:flutter_weather_bg/flutter_weather_bg.dart';

Usage

Drop a WeatherBg into your widget tree, and pass the desired weatherType together with a width and a height:

import 'package:flutter/material.dart';
import 'package:flutter_weather_bg/flutter_weather_bg.dart';

class WeatherDemo extends StatelessWidget {
  const WeatherDemo({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: WeatherBg(
        weatherType: WeatherType.thunder,
        width: MediaQuery.of(context).size.width,
        height: MediaQuery.of(context).size.height,
      ),
    );
  }
}

Switching weatherType at runtime will automatically trigger a cross-fade animation.

A full demo (covering PageView, ListView, GridView, size animation and type switching) lives in example/.

Preview

Regular PageView effect

home

ListView effect

list

GridView effect with a dynamically-switchable column count

grid

Dynamic size demonstration

width_height

Weather type cross-fade transition

transition

Contributing

Issues and pull requests are welcome — feel free to open one on the issue tracker.

If you want to run the example locally:

git clone https://github.com/xiaweizi/flutter_weather_bg.git
cd flutter_weather_bg/example
flutter pub get
flutter run              # or: flutter run -d chrome

License

Released under the MIT License. Copyright © 2020-2026 xiaweizi.

Star History

Star History Chart

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。