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

custom_sliding_segmented_control 封面
套件詳情v2.0.0

custom_sliding_segmented_control

允許您靈活地設定顯示控制項的 widget。您可以新增顏色、速度、大小、初始值、動畫等。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
6萬
喜歡數
232
Pub 分數
150

安裝套件

flutter pub add custom_sliding_segmented_control

套件介紹

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

一個靈活的 Flutter 小部件,用於建立可滑動的分段控制,支援自訂外觀與行為。它支援調整顏色、動畫速度、大小、初始選擇,以及段之間的平滑過渡。非常適合透過互動式、視覺上吸引人的標籤式導航來增強使用者介面。此控制項高度可設定,並可在所有主要平台(包含 Android、iOS、Web、macOS、Windows 與 Linux)上運作。

適用情境

  • 自定義標籤導航
  • 互動式表單篩選
  • 動態內容切換
  • 使用者偏好選擇器
  • 動畫使用者介面轉換

主要特色

  • 可設定顏色
  • 可調動畫速度
  • 可調整大小的段落
  • 初始值設定
  • 平滑的滑動動畫
  • 跨平台支援

適合對象

  • 需要自定義標籤介面的開發人員
  • 想要動畫控制項的設計人員
  • 具有動態內容過濾功能的應用程式
  • UI密集型應用
  • 跨平台 Flutter 項目

使用建議

  • 需要仔細處理狀態管理
  • 可能需要針對大量段數量進行效能調校
  • 某些區域的文件有限
  • 最佳搭配清晰的視覺反饋使用

原始 README

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

CustomSlidingSegmentedControl

Allows you to flexibly configure the widget for displaying controls. You can add color, speed, size, initial value, animation and more.

Example
import 'package:custom_sliding_segmented_control/custom_sliding_segmented_control.dart';

CustomSlidingSegmentedControl<int>(
  initialValue: 2,
  children: {
    1: Text('News daily portal'),
    2: Text('Map'),
    3: Text('Paper'),
  },
  decoration: BoxDecoration(
    color: CupertinoColors.lightBackgroundGray,
    borderRadius: BorderRadius.circular(8),
  ),
  thumbDecoration: BoxDecoration(
    color: Colors.white,
    borderRadius: BorderRadius.circular(6),
    boxShadow: [
      BoxShadow(
        color: Colors.black.withOpacity(.3),
        blurRadius: 4.0,
        spreadRadius: 1.0,
        offset: Offset(
          0.0,
          2.0,
        ),
      ),
    ],
  ),
  duration: Duration(milliseconds: 300),
  curve: Curves.easeInToLinear,
  onValueChanged: (v) {
    print(v);
  },
),

More examples

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案