segmented_pill_control
A fluid sliding segmented pill control for Flutter with spring animations, badge indicators, custom styling, and haptic feedback.
β¨ 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.