搜索插件、代码仓与 APP 分类

weather_animation 封面
插件详情v1.2.0

weather_animation

该包包含美丽的天气动画。通过天气配置器轻松设置!

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
1040
喜欢数
133
Pub 分数
160

安装插件

flutter pub add weather_animation

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

weather_animation 包为 Flutter 应用提供了视觉上吸引人的天气主题动画,包括雨、雪和云等动态效果。该包设计注重易用性,包含一个天气配置器,可快速设置和自定义。非常适合用于增强应用背景或在多个平台上创建沉浸式天气体验。动画流畅且性能出色,充分利用了 Flutter 的渲染能力。支持 Android、iOS、Web、macOS、Windows 和 Linux,适用于跨平台项目。

适合场景

  • 通过天气效果增强应用背景
  • 创建沉浸式天气仪表板
  • 为天气预报应用增添视觉魅力
  • 通过动画界面提升用户参与度
  • 设计主题化的移动或网页应用

主要特点

  • 预构建的天气动画(雨、雪、云)
  • 易于使用的天气配置工具
  • 跨平台支持
  • 跨设备的流畅性能
  • 可自定义的动画参数
  • 与 Flutter 渲染引擎的集成

适合对象

  • 寻求视觉增强的App开发者
  • 设计天气主题 UI 的设计师
  • 需要动画背景效果的项目
  • 跨平台 Flutter 应用程序
  • 希望快速实现丰富视觉效果的开发者

使用建议

  • 可能会影响低端设备的性能
  • 复杂场景需要仔细优化
  • 限于预定义的天气类型
  • 最适合用于背景层,不适合交互元素
  • 依赖于Flutter的图形渲染管线进行渲染

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

telegram_badge pub_badge configurator_badge repo_star_badge license_badge code_size_badge

all_scenes

🌇 weather_animation

Create weather scenes and animate as your heart desires. Simple and free.

Try the Weathunits configurator for setting weather scenes directly in the WEB!

Put an on Pub and favorite ⭐ on GitHub to keep up with changes and not miss new releases!

Motivation

  • 🎨 colorful weather scenes without using gif/png and stuff source
  • 🆓 free license for use in your projects (including commercial ones)
  • 🎛 easy creation of scenes and easy customization when needed
  • 🌅 configurator for easy creation of weather scenes
  • 😅 enjoy yourself and you with another fun package

Table of Contents

How to use simply?

Import the library:

import 'package:weather_animation/weather_animation.dart';
Use WeatherScene

Check the provided list of ready-made weather scenes in the WeatherScene enumeration and select the desired one through the getter:

@override
Widget build(BuildContext context) {
  return WeatherScene.sunset.sceneWidget;
}

or for more customization, use WrapperScene.weather:

@override
Widget build(BuildContext context) {
  return WrapperScene.weather(scene: WeatherScene.sunset);
}
Use WrapperScene

Specify a list of weather widgets and a list of colors to create a beautiful background gradient:

@override
Widget build(BuildContext context) {
  return const WrapperScene(
      colors: [
        Color(0xff283593),
        Color(0xffff8a65),
      ],
      children: [
        SunWidget(),
        CloudWidget(),
        WindWidget(),
      ],
    );
}

If necessary, specify a configuration file to fine-tune the weather widget:

// ...
SunWidget(
  sunConfig: SunConfig(
    width: 262.0,
    blurSigma: 10.0,
    blurStyle: BlurStyle.solid,
    isLeftLocation: true,
    coreColor: Color(0xffffa726),
    midColor: Color(0xd6ffee58),
    outColor: Color(0xffff9800),
    animMidMill: 2000,
    animOutMill: 1800,
  ),
),
// ...
Use weather_configurator app
  • online in web → Weathunits configurator
  • offline after build project on your gadget (path example/weathunits_configurator. Learn more here)

Library structure

The only point of using the library is to import the following file:

import 'package:weather_animation/weather_animation.dart';

The following weather widgets are available:

Widget weather A configuration class
CloudWidget CloudConfig
RainWidget
RainDropWidget*
RainConfig
SnowWidget
SnowflakeWidget*
SnowConfig
SunWidget SunConfig
ThunderWidget
SingleThunderWidget*
ThunderConfig
WindWidget WindConfig

💡Tip: Widgets under * represent a single weather item. Use these when another Stack setting is required.

Each weather widget accepts an optional configuration parameter to fine-tune the widget.

Configuration files ...Config
  • have correctly toString, operator ==, hashCode
  • have a copyWith method to clone the object
  • have de/serialization handling (toJson and fromJson). Note: not all fields
  • are inherited from class WeatherConfig
About WrapperScene

Also, there is a WrapperScene widget for quick scene adjustment, which allows you to scale the weather scene relative to the specified canvas dimensions. Has a clipper and scene widget decoration.

About BackgroundWidget

The BackgroundWidget class allows you to create a color background in the form of a linear gradient. Specify the desired colors and you're done.

Author

You can contact me or check out my activities on the following platforms:

Additional information

Made with ❤️. Enjoy it!


🏷 tags: weather, animation, weather conditions, weather scenes

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目