Skip to content
pubscout

custom_sliding_segmented_control

2.0.0, released 3 months ago by an unverified publisher

A custom sliding segmented control widget with flexible configuration and animations.

WASM-readyUses material_ui
$ flutter pub add custom_sliding_segmented_control
Source repository

What it does

Allows you to build and customize a sliding segmented control widget with configurable colors, animation duration, curves, sizes, and initial values. It supports custom decorations for both the main panel and the sliding thumb.

AI-written summary of version 2.0.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a custom segmented control with smooth sliding animations between options.
  • You want to style both the background container and the active segment thumb independently using BoxDecoration.

Skip it when

  • You require standard platform-native segmented controls without custom styling.
  • You need complex navigation routing tied directly to the tabs.

Strengths

  • Highly configurable decorations for both container and thumb
  • Supports custom animation curves and durations
  • Dynamic initial values and size calculations on orientation change

Weaknesses

  • Limited documentation on advanced properties beyond the basic README example
  • Relies entirely on custom UI implementation rather than native look-and-feel bindings

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2
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),
  ),
  duration: Duration(milliseconds: 300),
  curve: Curves.easeInToLinear,
  onValueChanged: (v) {
    print(v);
  },
)

Alternatives

Packages that do the same job and could replace custom_sliding_segmented_control.

Works with

Packages commonly used together with custom_sliding_segmented_control: ones it builds on, ones built on it, and its own family.