搜索插件、代码仓与 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

所属分类

源码仓库

使用此插件的项目

暂无相关数据。