polar_tab_bar 0.0.2
polar_tab_bar: ^0.0.2 copied to clipboard
A decent & customizable rounded tabbar with built-in PageView that can save UI state
Polar Tab Bar #
A decent & customizable rounded tabbar with built-in PageView that can save UI state.
There are two types of Polar Tab Bar, the Pill
annd the Step
Pill (PolarTabType.Pill ) |
Step (PolarTabType.Step ) |
---|---|
![]() |
![]() |
Get Started #
Add the polar_tab_bar
in your pubspec.yaml
dependencies:
...
polar_tab_bar: ^0.0.2
Basic Usage #
First create the tab items
final List<PolarTabItem> tabs = [
PolarTabItem(
index: 0,
title: "Home",
page: const PolarTabPage(
child: HomePage(),
),
),
PolarTabItem(
index: 1,
title: "Category",
page: const PolarTabPage(child: CategoryPage()),
),
PolarTabItem(
index: 2,
title: "Profile",
page: const PolarTabPage(child: ProfilePage()),
),
];
Note: Wrap your child widget with PolarTabPage
to save UI state on each navigation
Then you can use PolarTabBar
on your widget
Scaffold(
appBar: AppBar(
elevation: 0,
backgroundColor: Colors.indigoAccent,
title: const Text(
"Polar Tabbar",
style: TextStyle(
color: Colors.white,
fontSize: 16,
),
),
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(16),
child: PolarTabBar(
type: PolarTabType.pill, // Default Type
tabs: tabs
),
),
),
)
Customization #
type
(Default:PolarTabType.pill
) - Type of tab barpageController
(Optional) - Provide if you want full control of the internalPageView
height
(Optional) - Provide height if you usePolarTabBar
inside Scrolling parent (ListView
,SingleChildScrollView
, or else)contentSpacing
- Spacing on each tab itemsinnerPadding
- Spacing inside tab's pillradius
- Tab item's border radiusbackground
(Optional) - Inactive background color of tab's pillactiveBackground
(Optional) - Active background color of tab's pilltitleStyle
(Optional) - TextStyle of inactive titleactiveTitleStyle
(Optional) - TextStyle of active titleisDense
() - Make the tab more compactcurve
- Animation's curveduration
(Default:300ms
) - Animation's durationswipable
(Default:true
) - MakePageView
swipable