Skip to main content
The Stac Scaffold allows you to build a Flutter scaffold widget using JSON. To know more about the scaffold widget in Flutter, refer to the official documentation.

Properties

PropertyTypeDescription
appBarStacWidgetThe app bar widget of the scaffold.
bodyStacWidgetThe body widget of the scaffold.
floatingActionButtonStacWidgetThe floating action button widget of the scaffold.
floatingActionButtonLocationStacFloatingActionButtonLocationThe location of the floating action button.
persistentFooterButtonsList<StacWidget>The persistent footer buttons of the scaffold.
persistentFooterAlignmentStacAlignmentDirectionalThe alignment of the persistent footer buttons.
drawerStacWidgetThe drawer widget of the scaffold.
onDrawerChangedStacActionAction called when the drawer is opened or closed.
endDrawerStacWidgetThe end drawer widget of the scaffold.
onEndDrawerChangedStacActionAction called when the end drawer is opened or closed.
bottomNavigationBarStacWidgetThe bottom navigation bar widget of the scaffold.
bottomSheetStacWidgetThe bottom sheet widget of the scaffold.
backgroundColorStacColorThe background color of the scaffold.
resizeToAvoidBottomInsetboolWhether the scaffold should resize to avoid the bottom inset.
primaryboolWhether the scaffold is the primary scaffold. Defaults to true.
drawerDragStartBehaviorStacDragStartBehaviorThe drag start behavior for the drawer. Defaults to DragStartBehavior.start.
extendBodyboolWhether the body should extend into the scaffold’s bottom padding. Defaults to false.
extendBodyBehindAppBarboolWhether the body should extend behind the app bar. Defaults to false.
drawerScrimColorStacColorThe color of the scrim for the drawer.
drawerEdgeDragWidthdoubleThe width of the edge drag area for the drawer.
drawerEnableOpenDragGestureboolWhether the drawer can be opened with a drag gesture. Defaults to true.
endDrawerEnableOpenDragGestureboolWhether the end drawer can be opened with a drag gesture. Defaults to true.
restorationIdStringThe restoration ID to save and restore the state of the scaffold.

Example

StacScaffold(
  appBar: StacAppBar(
    title: StacText(data: 'App Bar Title'),
  ),
  body: StacCenter(
    child: StacText(data: 'Hello, World!'),
  ),
  floatingActionButton: StacFloatingActionButton(
    child: StacIcon(icon: 'add'),
    onPressed: {'type': 'function', 'name': 'onFabPressed'},
  ),
  backgroundColor: StacColors.white,
  drawer: StacDrawer(
    child: StacColumn(
      children: [
        StacText(data: 'Drawer Item 1'),
        StacText(data: 'Drawer Item 2'),
      ],
    ),
  ),
)