A Flutter package for building highly customizable, animated, and reusable tab bars. Supports multiple indicator types, animations, and wrapper styles for tab items.
- Multiple indicator types: underline, gradient, rounded, dot, bubble, rectangle, topLine, customPainter, custom.
- Flexible animations: fade, scale, slide, bounceSimple, bounceAdvanced.
- Wrapper support for both selected and unselected states.
- Supports Lottie, Image, and simple text/icon tabs.
- Customizable padding, colors, and animation curves.
- Easy integration with
TabController.
Add this to your pubspec.yaml:
dependencies:
reusable_tab_bar: <letest_version>Then run:
flutter pub getimport 'package:flutter/material.dart';
import 'package:reusable_tab_bar/reusable_tab_bar.dart';
class MyTabBarScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final TabController tabController = TabController(length: 3, vsync: ScaffoldState());
final tabs = [
Tab(text: 'Home'),
Tab(text: 'Search'),
Tab(text: 'Profile'),
];
return Scaffold(
appBar: AppBar(
bottom: TabBar(
controller: tabController,
tabs: TabBuilder.build(
controller: tabController,
customTabs: tabs,
animation: TabAnimationModel(
animationType: AnimationType.scale,
),
),
),
),
body: TabBarView(
controller: tabController,
children: [
Center(child: Text('Home')),
Center(child: Text('Search')),
Center(child: Text('Profile')),
],
),
);
}
}TabBar(
controller: tabController,
indicator: TabIndicatorFactory.build(
type: IndicatorType.rounded,
color: Colors.blue,
borderRadius: 12,
),
tabs: tabs,
)final animation = TabAnimationModel(
animationType: AnimationType.bounceAdvanced,
duration: Duration(milliseconds: 300),
scaleFactor: 1.2,
);
TabBuilder.build(
controller: tabController,
customTabs: tabs,
animation: animation,
);You can wrap your tabs with custom styles using WrapperType and WrapperModel:
TabBuilder.build(
controller: tabController,
tabItems: myTabItems,
wrapperType: WrapperType.shadow,
wrapperModel: WrapperModel(
borderRadius: 8,
shadowColor: Colors.black26,
),
animation: animation,
);IndicatorType: none, underline, gradient, rounded, dot, bubble, rectangle, topLine, customPainter, custom.AnimationType: fade, scale, slide, bounceSimple, bounceAdvanced, all, none.
TabAnimationModel: Configure animations including type, duration, scaleFactor, colors, padding, curves, and wrapper support.WrapperModel: Customizes wrapper appearance.
BounceTabAnimator- Bouncy scaling animation.FadeTabAnimator- Fade in/out animation.ScaleTabAnimator- Scale selected tab.SlideTabAnimator- Slide tab up/down.TabAnimator- General purpose animated tab.
TabAnimatorFactory- Returns the correct tab animator based onTabAnimationModel.TabAnimatedBuilder- Builds a list of animated tabs.TabIndicatorFactory- BuildsDecorationfor Tab indicators.TabBuilder- Builds tabs with optional animation and wrapper.TabFactory- Creates tab widgets fromTabItemModel.
Note: All animations respect selected/unselected wrappers and can be combined with custom styles and indicators for a fully flexible tab bar solution.
Made with ❤️ using SOLID principles and composable widgets for clean and maintainable UI components.
© MIT License. Developed with ❤️ by Shohidul Islam