FLUTTER ECOSYSTEM

hadukin/custom_sliding_segmented_control

自定義滑動分段控制項

自定義滑動分段控制項 專案封面
Stars
49
Forks
29
最近推送(UTC)
2026年9月3日
專案狀態
未封存
hadukin GitHub avatar
GITHUB User

hadukin ↗

語言DartC++CMakeSwiftCHTMLKotlinObjective-C

此儲存庫發佈的套件

使用的依賴

依賴清單 5 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

CustomSlidingSegmentedControl

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

https://raw.githubusercontent.com/hadukin/custom_sliding_segmented_control/main/screenshot/screenshot_3.png

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