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

animate_gradient 封面
套件詳情v0.0.4

animate_gradient

此套件讓您輕鬆製作動畫漸層。只要傳入主要和次要顏色,就完成了。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
6430
喜歡數
215
Pub 分數
160

安裝套件

flutter pub add animate_gradient

套件介紹

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

Animate Gradient 是一個 Flutter 套件,可簡化動畫漸變的建立。僅需提供主要與次要顏色,開發者即可輕鬆在各種 UI 元素上產生流暢、動態的漸變過渡。它支援多個平台,包括 Android、iOS、Web、macOS、Windows 與 Linux,非常適合跨平台應用。此套件內部處理動畫邏輯,減少重複程式碼,並能快速整合至現有專案。適用於現代且視覺吸引人的介面。

適用情境

  • 建立動態應用背景
  • 增強啟動畫面
  • 使用顏色過渡動畫化UI元素
  • 設計互動式按鈕
  • 建構視覺上吸引人的引導流程

主要特色

  • 基於顏色的簡單設定
  • 平滑漸變動畫
  • 跨平台相容性
  • 所需的設定最少
  • 內建動畫處理

適合對象

  • Flutter 初學者
  • UI/UX 設計師
  • 跨平台應用程式開發者
  • 需要視覺魅力的應用程式

使用建議

  • 除了顏色和速度之外,自訂選項有限
  • 可能影響低階裝置的效能
  • 不適合複雜的漸變圖案

原始 README

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

Animate Gradient

pub Animated-Gradient

This Package lets you make animated gradients without any hassle. Just pass the primary and secondary colors and you're done. You can do amazing effects using the alignments. For More info read the docs below.

Usage

Create your first animated gradient.

The only two required arguments are the primaryColors and secondaryColors.

| primaryColors length must greater or equal to 2.| | secondaryColors length must be equal to primaryColors length.|

    import 'package:animate_gradient/animate_gradient.dart';

     AnimateGradient(
        primaryColors: const [
          Colors.pink,
          Colors.pinkAccent,
          Colors.white,
        ],
        secondaryColors: const [
          Colors.blue,
          Colors.blueAccent,
          Colors.white,
        ],
        child: YourWidget(),
      ),
drawing
Play with alignments.

Alignments are optional. You can pass any of the following alignments.

primaryBegin primaryEnd secondaryBegin secondaryEnd

With this in place, you can have some crazy effects.

   import 'package:animate_gradient/animate_gradient.dart';

    AnimateGradient(
       primaryBegin: Alignment.topLeft,
       primaryEnd: Alignment.bottomLeft,
       secondaryBegin: Alignment.bottomLeft,
       secondaryEnd: Alignment.topRight,
       primaryColors: const [
         Colors.pink,
         Colors.pinkAccent,
         Colors.white,
       ],
       secondaryColors: const [
         Colors.white,
         Colors.blueAccent,
         Colors.blue,
       ],
       child: YourWidget(),
     ),
drawing
Alternatively! Use AlignemntGeometry for better control

With the apps built in rtl format normal Alignments cannot always work. So, you can use AlignemntGeometry instead.

primaryBegin --> primaryBeginGeometry

primaryEnd --> primaryEndGeometry

secondaryBegin --> secondaryBeginGeometry

secondaryEnd --> secondaryEndGeometry

With this, you also have an additional property textDirectionForGeometry. This will be used to resolve the AlignmentGeometry

   import 'package:animate_gradient/animate_gradient.dart';

    AnimateGradient(
      primaryBeginGeometry: const AlignmentDirectional(0, 1),
      primaryEndGeometry: const AlignmentDirectional(0, 2),
      secondaryBeginGeometry: const AlignmentDirectional(2, 0),
      secondaryEndGeometry: const AlignmentDirectional(0, -0.8),
      textDirectionForGeometry: TextDirection.rtl,
       primaryColors: const [
         Colors.pink,
         Colors.pinkAccent,
         Colors.white,
       ],
       secondaryColors: const [
         Colors.white,
         Colors.blueAccent,
         Colors.blue,
       ],
       child: YourWidget(),
     ),
drawing

Please note that AlignmentGeometry will be given more priority over Alignment

Available properties

Property Type Description
primaryColors List Starting colors of the animation.
secondaryColors List Ending colors of the animation.
primaryBegin Alignment? Starting Alignment of primaryColors.
primaryEnd Alignment? Ending Alignment of primaryColors.
secondaryBegin Alignment? Starting Alignment of secondaryColors.
secondaryEnd Alignment? Ending Alignment of secondaryColors.
primaryBeginGeometry AlignmentGeometry? Starting AlignmentGeometry of primaryColors.
primaryEndGeometry AlignmentGeometry? Ending AlignmentGeometry of primaryColors.
secondaryBeginGeometry AlignmentGeometry? Starting AlignmentGeometry of secondaryColors.
secondaryEndGeometry AlignmentGeometry? Ending AlignmentGeometry of secondaryColors.
textDirectionForGeometry TextDirection? TextDirection that will be used to resolve AlignmentGeometry
duration Duration? Duration between the transition.
controller AnimationController?
You can pass your own animation controller and use that

to control animation however you want.
animateAlignments bool? If you want to animate alignments.
reverse bool? If you want to reverse the animation.
repeat bool? If you want to repeat the animation.
curve Curve? The curve to use for the animation.
child Widget? You can pass your widget.

Author

This plugin is developed by Vikas Kumar.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。