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

套件詳情v0.0.5

flutter_shine

Flutter Shine 是一個用於美觀陰影的程式庫,支援動態光源位置、極度可自訂的陰影,無任何程式庫依賴,並能根據內容產生文字或框陰影。

近 30 天下載
49
喜歡數
49
Pub 分數
35

安裝套件

flutter pub add flutter_shine

套件介紹

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

Flutter Shine 是一個輕量級、無依賴的程式庫,可讓 Flutter 應用程式實現視覺上吸引人且動態的陰影效果。它支援隨內容自適應的文字與方塊陰影,並可自訂光源位置以達成真實的照明效果。設計簡潔彈性,不需額外套件即可為介面增添細膩且動畫化的陰影。適合對層次感與互動性有要求的現代化精緻介面。

適用情境

  • 在按鈕上建立動態陰影
  • 增強文字的逼真照明效果
  • 設計互動式 UI 元素
  • 為卡片和容器增加深度
  • 建構動畫視覺反饋
  • 透過最少的程式碼提升應用美學

主要特色

  • 動態光源定位
  • 可自訂的陰影強度和顏色
  • 無外部依賴
  • 支援文字與框陰影
  • 內容感知陰影渲染
  • 輕量且高效

適合對象

  • 尋求視覺精緻的UI設計師
  • 希望快速上手的開發者
  • 包含互動式或動畫元素的應用程式
  • 專注於現代材質設計的專案
  • 重視效能與大小的團隊

使用建議

  • 僅限陰影效果
  • 無內建動畫控制
  • 需要手動設定以實現複雜行為
  • 不適合用於複雜的3D效果
  • 最佳搭配簡潔、乾淨的 UI 版面配置使用

原始 README

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

Image 1

Flutter Shine

Pub Build Status Awesome Flutter

Show some :heart: and star the repo to support the project

GitHub stars GitHub forks GitHub watchers GitHub followers
Twitter Follow

Flutter widget inspired by Shine

Installation

Add the Package

dependencies:
  flutter_shine: ^0.0.5

❔ Usage

Import this class
import 'package:flutter_shine/flutter_shine.dart';
Flutter Shine

See how easy it is to create a shadow on text and on a container.

Exemple
FlutterShine(
    builder: (BuildContext context, ShineShadow shineShadow) {
        return Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            mainAxisSize: MainAxisSize.max,
            children: <Widget>[
                Text(
                    "Shine",
                    style: TextStyle(
                        fontSize: 100,
                        color: Colors.white,
                        shadows: shineShadow.shadows),
                ),
                Divider(),
                Container(
                    width: 300,
                    height: 300,
                    decoration: BoxDecoration(
                        color: Colors.white, boxShadow: shineShadow.boxShadows),
                )
            ],
        );
    },
),

Extremely customizable shadow with a dynamic light positions.

You can customize follows values :

  • number of Steps : The density of the shadow
  • opacity : The opacity of the shadow
  • opacity Power : The opacity power
  • offset : The offset of the shadow
  • offset Power : The offset power
  • blur : The blur of the shadow
  • blur Power : The blur power
  • shadow Color : The color of the shadow
Exemple
FlutterShine(
    [config: Config(shadowColor: Colors.red[300]),]
    [light: Light(intensity: 1, position: Point(x, y)),]
    builder: (BuildContext context, ShineShadow shineShadow) {
        return Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            mainAxisSize: MainAxisSize.max,
            children: <Widget>[
                Text(
                    "Shine",
                    style: TextStyle(
                        fontSize: 100,
                        color: Colors.white,
                        shadows: shineShadow.shadows),
                ),
                Divider(),
                Container(
                    width: 300,
                    height: 300,
                    decoration: BoxDecoration(
                        color: Colors.white, boxShadow: shineShadow.boxShadows),
                )
            ],
        );
    },
),

Examples

Web and command-line examples can be found in the example folder.

Web Examples

In order to run the web examples, please follow these steps:

  1. Clone this repo and enter the directory
  2. Run pub get
  3. Run pub run build_runner serve example
  4. Navigate to http://localhost:8080/web/ in your browser
Command Line Examples

In order to run the command line example, please follow these steps:

  1. Clone this repo and enter the directory
  2. Run pub get
  3. Run dart example/lib/main.dart
Flutter Example
Install Flutter

In order to run the flutter example, you must have Flutter installed. For installation instructions, view the online documentation.

Run the app
  1. Open up an Android Emulator, the iOS Simulator, or connect an appropriate mobile device for debugging.
  2. Open up a terminal
  3. cd into the example/lib/ directory
  4. Run flutter doctor to ensure you have all Flutter dependencies working.
  5. Run flutter packages get
  6. Run flutter run

Stargazers over time

Stargazers over time

License

MIT License

Copyright (c) 2020 Jonathan Monga

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。