搜索插件、代码仓与 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 项

源码仓库

使用此插件的项目