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

flutter_gradient_animation_text 封面
套件詳情v1.0.2

flutter_gradient_animation_text

透過輸入文字、顏色和動畫持續時間,輕鬆創建動態漸變文字。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
1050
喜歡數
42
Pub 分數
140

安裝套件

flutter pub add flutter_gradient_animation_text

套件介紹

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

一個 Flutter 套件,讓開發者能透過指定文字內容、漸層顏色與動畫持續時間,輕鬆建立動畫漸層文字。它簡化了在多個平台為應用程式加入視覺上吸引人、動態的文字效果的過程。此套件輕量且能無縫整合至現有的 Flutter 專案中,設定簡單。非常適合透過引人入勝的字型來增強 UI,而無需複雜的自訂動畫。

適用情境

  • 添加動畫漸變標題
  • 創建引人注目的應用標題
  • 增強啟動畫面
  • 設計互動式 UI 元素
  • 在引導流程中動畫化文字

主要特色

  • 簡單的 API,帶有文字和顏色輸入
  • 可自訂的動畫持續時間
  • 跨平台支援
  • 平滑的漸變過渡
  • 最小化樣板程式碼

適合對象

  • 尋求視覺魅力的UI設計師
  • 開發現代應用程式介面的開發者
  • 需要動畫字型的專案
  • 初學者學習Flutter動畫
  • 具有動態或互動式文字元素的應用程式

使用建議

  • 大量動畫文字帶來的效能影響
  • 除了漸層和持續時間外,自訂選項有限
  • 可能需要針對低階裝置進行優化
  • 動畫行為在不同平台之間可能有微小差異
  • 不適合靜態文字設計

原始 README

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

Static Badge Static Badge Static Badge Static Badge

This package lets you make animated gradient texts without any hassle. Just pass the text, colors, the duration of the animation and you're done! Using the transform and reverse, you can achieve amazing effects. For More info read the docs below.

Getting started

Install the package using the following command:

flutter pub add flutter_gradient_animation_text

Import the package in your dart file using the following code:

import 'package:flutter_gradient_animation_text/flutter_gradient_animation_text.dart';

And you are good to go!

Usage

Create your animated gradient text. The 3 required arguments are:

  1. text(Text): The text.
  2. colors(List<Colors>): List of colors you want in your gradient.
  3. duration(Duration): Duration for which a single gradient animation runs.
// rainbow text
GradientAnimationText(
    text: Text(
        'Rainbow Text 1',
        style: TextStyle(
            fontSize: 50,
        ),
    ),
    colors: [
        Color(0xff8f00ff),  // violet
        Colors.indigo,
        Colors.blue,
        Colors.green,
        Colors.yellow,
        Colors.orange,
        Colors.red,
    ],
    duration: Duration(seconds: 5),
),

Rainbow Text 1

Reverse the animation. This plays the animation backwards when a single iteration of the forward animation is completed. You set reverse to true to enable this.

// rainbow text with reverse
GradientAnimationText(
    text: Text(
        'Rainbow Text 1',
        style: TextStyle(
            fontSize: 50,
        ),
    ),
    colors: [
        Color(0xff8f00ff),  // violet
        Colors.indigo,
        Colors.blue,
        Colors.green,
        Colors.yellow,
        Colors.orange,
        Colors.red,
    ],
    duration: Duration(seconds: 5),
    reverse: true,  // reverse
),

Rainbow Text 2

Play with colors. It is possible to use the same color more than once to increase the area it covers. Gold Text Example: The following 2 Gold Text animations have different number of Colors.amber color.

// gold text 1
GradientAnimationText(
    text: Text(
        'Gold Text 1',
        style: TextStyle(
            fontSize: 50,
            fontWeight: FontWeight.bold,
        ),
    ),
    colors: [
        Colors.amber,   // 1
        Colors.white,
    ],
    duration: Duration(seconds: 5),
    reverse: true,
),
// gold text 2
GradientAnimationText(
    text: Text(
        'Gold Text 2',
        style: TextStyle(
            fontSize: 50,
            fontWeight: FontWeight.bold,
        ),
    ),
    colors: [
        Colors.amber,   // 1
        Colors.amber,   // 2
        Colors.amber,   // 3
        Colors.white,
    ],
    duration: Duration(seconds: 5),
    reverse: true,
),

Gold Text

Transform your gradient. You can transform your gradient using transform property. Use GradientTranform classes such as SweepGradient, and GradientRotation to tranform.

// Tranform Text
GradientAnimationText(
    text: Text(
    'Tranform Text',
        style: TextStyle(
            fontSize: 90,
            fontWeight: FontWeight.bold,
        ),
    ),
    colors: [
        Color(0xFF061A9C),
        Color(0xff92effd),
    ],
    duration: Duration(seconds: 5),
    transform: GradientRotation(math.pi / 4),   // tranform
),

Tranform Text

Available Properties

Property Type Description
text Text The text to be used in the animation.
colors List Colors of the animation.
duration Duration Duration for which a single gradient animation runs.
reverse bool? If you want to reverse the animation.
transform GradientTransform? You can transform your gradient.

Author

This package is developed by Sahil Shah.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。