Skip to main content

TabBar

The Stac TabBar allows you to build a Flutter TabBar widget using JSON. To know more about the TabBar widget in Flutter, refer to the official documentation.

Properties​

PropertyTypeDescription
tabsList<Map<String, dynamic>>The tabs to display in the tab bar.
initialIndexintThe initial index of the selected tab. Defaults to 0.
isScrollableboolWhether the tab bar is scrollable. Defaults to false.
paddingStacEdgeInsets?The padding for the tab bar.
indicatorColorString?The color of the tab indicator.
automaticIndicatorColorAdjustmentboolWhether to automatically adjust the indicator color. Defaults to true.
indicatorWeightdoubleThe thickness of the tab indicator. Defaults to 2.0.
indicatorPaddingStacEdgeInsets?The padding for the tab indicator.
indicatorSizeTabBarIndicatorSize?The size of the tab indicator.
labelColorString?The color of the selected tab label.
labelStyleStacTextStyle?The text style of the selected tab label.
labelPaddingStacEdgeInsets?The padding for the selected tab label.
unselectedLabelColorString?The color of the unselected tab labels.
unselectedLabelStyleStacTextStyle?The text style of the unselected tab labels.
dragStartBehaviorDragStartBehaviorThe drag start behavior. Defaults to DragStartBehavior.start.
enableFeedbackbool?Whether to enable feedback for taps.
physicsStacScrollPhysics?The scroll physics for the tab bar.
tabAlignmentTabAlignment?The alignment of the tabs.

DefaultTabController

The Stac DefaultTabController allows you to build a Flutter DefaultTabController widget using JSON. To know more about the DefaultTabController widget in Flutter, refer to the official documentation.

Properties​

PropertyTypeDescription
lengthintThe number of tabs.
initialIndexintThe initial index of the selected tab. Defaults to 0.
childMap<String, dynamic>The widget below this widget in the tree.

Tab

The Stac Tab allows you to build a Flutter Tab widget using JSON. To know more about the Tab widget in Flutter, refer to the official documentation.

Properties​

PropertyTypeDescription
textString?The text to display in the tab.
iconMap<String, dynamic>?The icon to display in the tab.
iconMarginStacEdgeInsets?The margin around the icon.
heightdouble?The height of the tab.
childMap<String, dynamic>?The widget below this widget in the tree.

TabBarView

The Stac TabBarView allows you to build a Flutter TabBarView widget using JSON. To know more about the TabBarView widget in Flutter, refer to the official documentation.

Properties​

PropertyTypeDescription
childrenList<Map<String, dynamic>>The widgets to display in each tab.
initialIndexintThe initial index of the selected tab. Defaults to 0.
dragStartBehaviorDragStartBehaviorThe drag start behavior. Defaults to DragStartBehavior.start.
physicsStacScrollPhysics?The scroll physics for the tab bar view.
viewportFractiondoubleThe fraction of the viewport that each page should occupy. Defaults to 1.0.
clipBehaviorClipThe clip behavior. Defaults to Clip.hardEdge.

Example JSON​

{
"type": "defaultTabController",
"length": 3,
"child": {
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "Tabbar"
},
"bottom": {
"type": "tabBar",
"tabs": [
{
"type": "tab",
"text": "Red"
},
{
"type": "tab",
"text": "Red"
},
{
"type": "tab",
"text": "Red"
}
]
}
},
"body": {
"type": "tabBarView",
"children": [
{
"type": "container",
"color": "#D9D9D9"
},
{
"type": "container",
"color": "#FC3F1B"
},
{
"type": "container",
"color": "#D9D9D9"
}
]
}
}
}