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

outline_gradient_button 封面
套件詳情v2.0.1+1

outline_gradient_button

OutlineGradientButton 套件用於建立具有漸變輪廓的按鈕。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
22
喜歡數
97
Pub 分數
150

安裝套件

flutter pub add outline_gradient_button

套件介紹

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

outline_gradient_button 套件讓開發者能在 Flutter 應用中建立具有漸變外框的視覺吸引力按鈕。它透過加入可自訂的漸變邊框,擴展標準按鈕組件,進而實現現代且動態的使用者介面設計。非常適合尋求時尚、醒目介面但又不犧牲功能性的應用。此套件支援所有主要平台,包含 Android、iOS、Web、macOS、Windows 與 Linux,確保跨裝置外觀一致。僅需透過 pub add 進行最少設定,即可順暢整合至現有專案。

適用情境

  • 建立時尚的使用者介面元件
  • 增強應用的視覺吸引力
  • 設計互動式操作按鈕
  • 建構現代移動與網頁介面
  • 為表單按鈕添加漸變效果

主要特色

  • 漸層輪廓樣式
  • 跨平台相容性
  • 與 Flutter 的輕鬆整合
  • 可自定的邊框顏色和寬度
  • 支援各種按鈕類型(例如 ElevatedButton、TextButton)
  • 輕量且高效

適合對象

  • 尋求視覺魅力的UI設計師
  • 開發現代 Flutter 應用的開發者
  • 需要基於梯度的互動元件的專案
  • 針對多個平台的應用程式
  • 原型設計與生產就緒的介面

使用建議

  • 可能需要額外的樣式來處理複雜的漸變
  • 僅限輪廓效果,不支援填滿漸層
  • 大量按鈕對效能的影響
  • 最好與對比度高的背景色搭配以提高可見性

原始 README

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

wow

Example

Take a look at the provided example for how to use the OutlineGradientButton.

How to use

demo_button1

OutlineGradientButton(
  child: Text('WOW'),
  gradient: LinearGradient(
    colors: [Colors.purple, Colors.pink],
    begin: Alignment.topCenter,
    end: Alignment.bottomCenter,
  ),
  strokeWidth: 4,
),

demo_button2

OutlineGradientButton(
  child: Text('TEXT'),
  gradient: LinearGradient(colors: [Colors.pink, Colors.purple]),
  strokeWidth: 4,
  radius: Radius.circular(8),
),

demo_button3

OutlineGradientButton(
  child: Text('OMG'),
  gradient: LinearGradient(
    stops: [0, 0.5, 0.5, 1],
    colors: [Colors.green, Colors.green, Colors.red, Colors.red],
  ),
  strokeWidth: 4,
  corners: Corners(topLeft: Radius.elliptical(16, 14), bottomRight: Radius.circular(6)),
),

demo_button4

OutlineGradientButton(
  child: SizedBox(
    width: 52,
    height: 52,
    child: Column(
      mainAxisSize: MainAxisSize.min,
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[
        Icon(Icons.opacity, color: Colors.grey, size: 24),
        Text('TEXT', style: TextStyle(fontSize: 9)),
      ],
    ),
  ),
  gradient: LinearGradient(
    colors: [Colors.blue, Colors.black],
    begin: Alignment(-1, -1),
    end: Alignment(2, 2),
  ),
  strokeWidth: 4,
  padding: EdgeInsets.zero,
  radius: Radius.circular(26),
),

demo_button5

OutlineGradientButton(
  child: Text('Linear gradient', style: TextStyle(color: Colors.black, fontSize: 10)),
  gradient: LinearGradient(
    colors: List.generate(360, (h) => HSLColor.fromAHSL(1, h.toDouble(), 1, 0.5).toColor()),
  ),
  strokeWidth: 2,
  padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
  radius: Radius.circular(8),
),

demo_button6

OutlineGradientButton(
  child: Text('Sweep gradient', style: TextStyle(color: Colors.black, fontSize: 10)),
  gradient: SweepGradient(
    colors: List.generate(360, (h) => HSLColor.fromAHSL(1, h.toDouble(), 1, 0.5).toColor()),
  ),
  strokeWidth: 2,
  padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
  radius: Radius.circular(8),
),

demo_button7

OutlineGradientButton(
  child: Text('With background color and elevation', style: TextStyle(color: Colors.white, fontSize: 12)),
  gradient: LinearGradient(colors: [Colors.greenAccent, Colors.yellow]),
  strokeWidth: 2,
  padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
  corners: Corners(topRight: Radius.circular(16), bottomRight: Radius.circular(16)),
  backgroundColor: Colors.lightBlue,
  elevation: 4,
  inkWell: true,
  onTap: () => showSnack('onTap'),
  onDoubleTap: () => showSnack('onDoubleTap'),
  onLongPress: () => showSnack('onLongPress'),
),

所屬分類

原始碼儲存庫

使用此套件的專案