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

glossy 封面
插件详情v0.0.5

glossy

Glossy:一个用于创建流畅的玻璃态UI效果的Flutter包,非常适合现代应用程序设计和时尚的用户界面。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
2790
喜欢数
115
Pub 分数
140

安装插件

flutter pub add glossy

插件介绍

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

Glossy 是一个 Flutter 包,可让开发者轻松实现流畅的玻璃拟态 UI 效果。它提供可自定义的半透明、磨砂玻璃样式的组件,非常适合现代应用设计。支持所有主要平台——包括 Android、iOS、Web、macOS、Windows 和 Linux——Glossy 通过深度和视觉吸引力增强用户界面。该包轻量且可通过简单的 pub add 命令无缝集成到现有的 Flutter 项目中。非常适合创建具有现代美感的时尚叠加层、卡片和浮动元素。

适合场景

  • 创建现代应用程序界面
  • 设计浮动UI卡片
  • 实现磨砂玻璃叠加
  • 通过透明度提升应用美观度
  • 构建简洁的导航栏
  • 为UI组件增加深度

主要特点

  • 通过 pub 轻松集成
  • 跨平台兼容性
  • 可自定义的模糊和不透明度
  • 支持阴影和边框
  • 轻量且高效
  • 预定义的玻璃拟态小部件

适合对象

  • 寻求现代外观的UI设计师
  • 开发时尚的应用程序的开发者
  • 需要半透明效果的项目
  • Flutter 初学者探索高级 UI
  • 面向高端用户体验的应用

使用建议

  • 对低端设备的性能影响
  • 除了模糊和颜色之外,自定义选项有限
  • 可能需要在不同屏幕密度上进行测试
  • 不适合高对比度无障碍需求
  • 最好搭配细微的设计元素使用

原始 README

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

Screenshots

App Screenshot

Overview

This Flutter package allows you to easily create glass morphism effects in your Flutter applications. Glass morphism is a design trend that involves using blurred, semi-transparent elements to create a frosted glass-like effect.

Installation

To use this package, add glossy as a dependency in your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  glossy: ^0.0.5

OR

Open your termilar in the project level and run this command.

flutter pub add glossy

Usage

You can use the GlossyContainer widget provided by this package to create glass morphism effects. Here's a basic example:

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

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        backgroundColor: Colors.black,
        appBar: AppBar(
          title: const Text('Glass Morphism Example'),
        ),
        body: Center(
          child: SizedBox(
            width: 300,
            height: 300,
            child: Stack(
              children: [
                Container(
                  height: 140,
                  width: 140,
                  decoration: (BoxDecoration(
                      color: Colors.purple,
                      borderRadius: BorderRadius.circular(70))),
                ),
                Align(
                  alignment: Alignment.bottomRight,
                  child: Container(
                    height: 140,
                    width: 140,
                    decoration: (BoxDecoration(
                        color: Colors.purple,
                        borderRadius: BorderRadius.circular(70))),
                  ),
                ),
                Align(
                  alignment: Alignment.center,
                  child: GlossyContainer(
                    width: 200,
                    height: 200,
                    borderRadius: BorderRadius.circular(12),
                    child: const Center(
                      child: Text(
                        'Glass Morphism',
                        style: TextStyle(
                          fontSize: 20,
                          fontWeight: FontWeight.bold,
                          color: Colors.white,
                        ),
                      ),
                    ),
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Parameters

  • width: The width of the container required.
  • height: The height of the container required.
  • borderRadius: The border radius of the container.
  • blur: The amount of blur to apply to the container.
  • child: The widget placed inside the glass container.
  • color: Background color of the container.
  • opacity: Opacity of the container.
  • strengthX: Strength of blur in the horizontal direction.
  • strengthY: Strength of blur in the vertical direction.
  • border: Border of the container.
  • blendMode: Blend mode for applying filter.
  • gradient: Gradient of the container.
  • boxShadow: Box shadows for the container.
  • image: Background image of the container.
  • imageOpacity: Opacity of the background image.

Support

If you find this project helpful and would like to support its development, you can connect with me on social media:

Your support and feedback are greatly appreciated and will help in further improving this project.

所属分类

源码仓库

使用此插件的项目