Skip to main content
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
leadingStacWidgetThe leading widget before the title.
titleStacWidgetThe title widget.
titleTextStyleStacTextStyleThe text style for the title.
toolbarTextStyleStacTextStyleThe text style for the toolbar.
shadowColorStacColorThe color of the shadow below the app bar.
backgroundColorStacColorThe background color of the app bar.
foregroundColorStacColorThe color of the app bar’s foreground elements.
surfaceTintColorStacColorThe surface tint color of the app bar.
actionsList<StacWidget>The list of widgets to display in a row after the title. Defaults to an empty list.
bottomStacWidgetThe bottom widget of the app bar.
titleSpacingdoubleThe spacing around the title.
toolbarOpacitydoubleThe opacity of the toolbar. Defaults to 1.0.
bottomOpacitydoubleThe opacity of the bottom widget. Defaults to 1.0.
toolbarHeightdoubleThe height of the toolbar.
leadingWidthdoubleThe width of the leading widget.
primaryboolWhether this app bar is the primary app bar for the scaffold. Defaults to true.
centerTitleboolWhether the title should be centered.
elevationdoubleThe elevation of the app bar.
scrolledUnderElevationdoubleThe elevation of the app bar when it is scrolled under.

Example

StacAppBar(
  title: StacText(data: 'App Bar Title'),
  backgroundColor: StacColors.white,
  foregroundColor: StacColors.black,
  actions: [
    StacIconButton(
      icon: StacIcon(icon: 'search'),
    ),
    StacIconButton(
      icon: StacIcon(icon: 'settings'),
    ),
  ],
)