segmented_pill_control

A fluid sliding segmented pill control for Flutter with spring animations, badge indicators, custom styling, and haptic feedback.

pub package License: MIT


✨ Features

  • 🍏 Apple-Grade Sliding Animation: Fluid sliding pill background with spring physics.
  • πŸ”΄ Badge Counters & Status Dots: Built-in support for numeric badges and notification dot indicators on individual segments.
  • 🎨 Deeply Customizable Theme: Easily configure background colors, pill elevation, border radii, text styles, and shadows.
  • πŸ“³ Haptic Feedback: Crisp tactile feedback (HapticFeedback.selectionClick()) when switching segments.
  • πŸŽ›οΈ Programmatic Controller: Navigate tabs from code using SegmentedPillController.
  • 🧹 Zero External Dependencies: Pure Flutter SDK implementation.

πŸš€ Getting Started

Add segmented_pill_control to your pubspec.yaml:

dependencies:
  segmented_pill_control: ^1.0.0

Import the package:

import 'package:segmented_pill_control/segmented_pill_control.dart';

πŸ’‘ Quick Example

SegmentedPillControl(
  initialIndex: 0,
  onChanged: (index) => print('Selected: $index'),
  segments: const [
    PillSegment(
      label: 'Inbox',
      icon: Icon(Icons.inbox),
      badgeCount: 5,
    ),
    PillSegment(
      label: 'Starred',
      icon: Icon(Icons.star),
      showBadgeDot: true,
    ),
    PillSegment(
      label: 'Archive',
      icon: Icon(Icons.archive),
    ),
  ],
)

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Created by Shahzain Baloch.