Skip to main content

AppBar

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

Properties​

PropertyTypeDescription
leadingMap<String, dynamic>?The leading widget before the title.
titleMap<String, dynamic>?The title widget.
titleTextStyleStacTextStyle?The text style for the title.
toolbarTextStyleStacTextStyle?The text style for the toolbar.
shadowColorString?The color of the shadow below the app bar.
backgroundColorString?The background color of the app bar.
foregroundColorString?The color of the app bar's foreground elements.
surfaceTintColorString?The surface tint color of the app bar.
actionsList<Map<String, dynamic>>The list of widgets to display in a row after the title. Defaults to an empty list.
bottomMap<String, dynamic>?The bottom widget of the app bar.
titleSpacingdouble?The spacing around the title.
toolbarOpacitydoubleThe opacity of the toolbar. Defaults to 1.0.
bottomOpacitydoubleThe opacity of the bottom widget. Defaults to 1.0.
toolbarHeightdouble?The height of the toolbar.
leadingWidthdouble?The width of the leading widget.
primaryboolWhether this app bar is the primary app bar for the scaffold. Defaults to true.
centerTitlebool?Whether the title should be centered.
elevationdouble?The elevation of the app bar.
scrolledUnderElevationdouble?The elevation of the app bar when it is scrolled under.

Example JSON​

{
"type": "appBar",
"title": {
"type": "text",
"data": "App Bar Title"
},
"backgroundColor": "#FFFFFF",
"foregroundColor": "#000000",
"actions": [
{
"type": "iconButton",
"icon": {
"type": "icon",
"icon": "search"
}
},
{
"type": "iconButton",
"icon": {
"type": "icon",
"icon": "settings"
}
}
]
}