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.