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

glowy_borders 封面
插件详情v1.0.2

glowy_borders

一个让您的边框发光的包

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
7250
喜欢数
84
Pub 分数
130

安装插件

flutter pub add glowy_borders

插件介绍

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

Glowy Borders 是一个 Flutter 包,通过为小部件边框添加鲜艳、动态的发光效果来增强 UI 设计。它允许开发者用极少的代码轻松地为任何小部件应用平滑且可自定义的发光效果。适用于现代应用程序界面,支持 Android、iOS、Web、macOS、Windows 和 Linux 多个平台。该包利用 Flutter 的渲染功能,提供流畅的动画和视觉深度。非常适合需要动态效果的按钮、卡片或交互元素。

适合场景

  • 创建动画按钮边框
  • 通过发光效果增强卡片 UI
  • 设计交互式 UI 组件
  • 为用户交互添加视觉反馈
  • 构建现代、简洁的应用程序界面

主要特点

  • 可自定义的发光颜色和强度
  • 平滑的动画过渡
  • 对多平台的支持
  • 与现有控件的轻松集成
  • 可配置的发光半径和模糊

适合对象

  • 寻求视觉魅力的UI设计师
  • 开发现代 Flutter 应用的开发者
  • 需要动画边框效果的项目
  • 针对跨平台一致性的应用
  • 创意或游戏风格的界面

使用建议

  • 可能会影响低端设备的性能
  • 需要仔细调整以获得最佳视觉平衡
  • 除了发光属性外,自定义选项有限
  • 不适合极简设计风格
  • 建议谨慎使用,以避免视觉杂乱

原始 README

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

This package provides a wrapper widget to animate borders around your widgets. You can choose to provide current Animation Progress externally or use an indefinitely animation.

| |

Features

AnimatedGradientBorder Widget
  • Wrapper to Animate widgets border with gradients and glow
  • Set animation progress manually or loop indefinitely
  • control size of glow, border and colors to achieve stunning effects

Getting started

Create your flutter app, import this package and use AnimatedGradientBorder to wrap some element.

Usage

In this example you only need to wrap the widget with a full size Column in your app to see the results. Also note the currentProgress variable which is used to set animation state. If you remove it or set it to null, the animation will play indefinitely.

Please Note that you will need to set the same border radius for the wrapper as well as the child to make it look like a true border.

Also note, that this widget will not work in stretched alignments if you don't provide the parameter stretchAlongAxis and specify which axis you want to stretch along


final widget = Scaffold(
  extendBody: true,
  body: SafeArea(
    child: Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          const Column(
            children: [Text('Hallo Welt')],
          ),
          AnimatedGradientBorder(
            borderSize: 2,
            glowSize: 10,
            gradientColors: [
              Colors.transparent,
              Colors.transparent,
              Colors.transparent,
              Colors.purple.shade50
            ],
            animationProgress: currentProgress,
            borderRadius: BorderRadius.all(Radius.circular(999)),
            child: SizedBox(
              width: 300,
              height: 300,
              child: Container(
                decoration: BoxDecoration(
                    borderRadius: BorderRadius.all(Radius.circular(999)),
                    color: Theme
                        .of(context)
                        .colorScheme
                        .secondaryContainer),
                child: Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Text("current value: $currentProgress",
                        style: TextStyle(color: Colors.white, fontSize: 30.0)),
                  ],
                ),
              ),
            ),
          ),
        ],
      ),
    ),
  ),
);

Additional information

This feature uses Backdrop Filter under the hood which can cause performance issues if used extensively. Keep that in mind.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。