reusable_tab_bar
A Flutter package for building highly customizable, animated, and reusable tab bars. Supports multiple indicator types, animations, and wrapper styles for tab items.
Features
- 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.
Installation
Add this to your pubspec.yaml:
dependencies:
reusable_tab_bar: <letest_version>
Then run:
flutter pub get
Usage
Basic Usage
import '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')),
],
),
);
}
}
Using Indicators
TabBar(
controller: tabController,
indicator: TabIndicatorFactory.build(
type: IndicatorType.rounded,
color: Colors.blue,
borderRadius: 12,
),
tabs: tabs,
)
Animations
final animation = TabAnimationModel(
animationType: AnimationType.bounceAdvanced,
duration: Duration(milliseconds: 300),
scaleFactor: 1.2,
);
TabBuilder.build(
controller: tabController,
customTabs: tabs,
animation: animation,
);
Wrappers
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,
);
Enums
IndicatorType: none, underline, gradient, rounded, dot, bubble, rectangle, topLine, customPainter, custom.AnimationType: fade, scale, slide, bounceSimple, bounceAdvanced, all, none.
Models
TabAnimationModel: Configure animations including type, duration, scaleFactor, colors, padding, curves, and wrapper support.WrapperModel: Customizes wrapper appearance.
Animators
BounceTabAnimator- Bouncy scaling animation.FadeTabAnimator- Fade in/out animation.ScaleTabAnimator- Scale selected tab.SlideTabAnimator- Slide tab up/down.TabAnimator- General purpose animated tab.
Factories
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.
License
© MIT License. Developed with ❤️ by Shohidul Islam
Libraries
- data/enums/sliver_type
- data/enums/tab_animation_type
- data/enums/tab_bar_layout_type
- data/enums/tab_bar_position_type
- data/enums/tab_bar_visual_style
- data/enums/tab_indicator_position
- data/enums/tab_indicator_type
- data/enums/tab_type
- data/enums/wrapper_type
- data/models/indicator_model
- data/models/tab_animation_model
- data/models/tab_item_model/image_tab_item_model
- data/models/tab_item_model/lottie_tab_item_model
- data/models/tab_item_model/simple_tab_model
- data/models/tab_item_model/tab_item_model
- data/models/wrapper_model
- data/widget_extension
- reusable_tab_bar
- type_def/type_def
- utils/rotate_widgets
- utils/tab_controller_listener
- view_models/provider/tap_bar_provider
- view_models/tab_bar_cubit
- views/screens/app_tab_bar
- views/screens/app_tab_bar_without_app_bar
- views/screens/bottom_sheet_tab_bar_screen
- views/screens/default_tab_provider
- views/screens/side_tab_bar_screen
- views/screens/simple_tab_bar_screen
- views/screens/sliver_custom_tab_bar_screen
- views/screens/sliver_nested_tab_bar_screen
- views/screens/stack_positioned_tab_bar_screen
- views/screens/standard_tab_bar_screen
- views/widgets/animations/styles/bounce_tab_animator
- views/widgets/animations/styles/fade_tab_animator
- views/widgets/animations/styles/i_tab_animator
- views/widgets/animations/styles/scale_tab_animator
- views/widgets/animations/styles/slide_tab_animator
- views/widgets/animations/styles/tab_animator
- views/widgets/animations/tab_animated_builder
- views/widgets/animations/tab_animator_factory
- views/widgets/animations/utils/selected_widget_wrapper_mixin
- views/widgets/image_view/image_view
- views/widgets/indicators/indicator_factory
- views/widgets/indicators/painters/custom_painter_decoration
- views/widgets/indicators/painters/point_tab_indicator
- views/widgets/indicators/painters/rounded_indicator_painter
- views/widgets/indicators/styles/base_tab_indicator_style
- views/widgets/indicators/styles/indicator_styles
- views/widgets/indicators/tab_bar_indicator_factory
- views/widgets/tab_app_bar_switcher
- views/widgets/tab_app_bars/floating_tab_bar
- views/widgets/tab_app_bars/sliver_tab_app_bar
- views/widgets/tab_app_bars/tab_app_bar
- views/widgets/tab_bars/composable_tab_bar_wrapper
- views/widgets/tab_bars/styled_tab_bar
- views/widgets/tab_bars/styles/base_tab_bar
- views/widgets/tab_bars/styles/blurred_tab_bar_style
- views/widgets/tab_bars/styles/elevated_tab_bar_style
- views/widgets/tab_bars/styles/filled_tab_bar_style
- views/widgets/tab_bars/styles/outlined_tab_bar_style
- views/widgets/tab_bars/styles/side_tab_bar
- views/widgets/tab_bars/styles/simple_tab_bar
- views/widgets/tab_bars/styles/simple_tab_bar_style
- views/widgets/tab_bars/tab_bar_style_factory
- views/widgets/tab_bars/tab_bar_style_strategy
- views/widgets/tab_bars/utils/tab_bar_helpers
- views/widgets/tab_fab_switcher
- views/widgets/tabs/styles/base_tab
- views/widgets/tabs/styles/custom_shape_tab
- views/widgets/tabs/styles/image_tab
- views/widgets/tabs/styles/lottie_tab
- views/widgets/tabs/styles/simple_tab
- views/widgets/tabs/tab_builder
- views/widgets/tabs/tab_factory
- views/widgets/widget_placement_builder/tab_bar_placement_builder
- views/widgets/widget_wrapper/blurred_wrapper
- views/widgets/widget_wrapper/card_wrapper
- views/widgets/widget_wrapper/glass_morphic_wrapper
- views/widgets/widget_wrapper/gradient_wrapper
- views/widgets/widget_wrapper/i_wrapper
- views/widgets/widget_wrapper/neu_morphic_wrapper
- views/widgets/widget_wrapper/none_wrapper
- views/widgets/widget_wrapper/outlined_container_wrapper
- views/widgets/widget_wrapper/padded_wrapper
- views/widgets/widget_wrapper/segmented_wrapper
- views/widgets/widget_wrapper/widget_wrapper_factory