Skip to main content

Scaffold

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
appBarMap<String, dynamic>?The app bar widget of the scaffold.
bodyMap<String, dynamic>?The body widget of the scaffold.
floatingActionButtonMap<String, dynamic>?The floating action button widget of the scaffold.
floatingActionButtonLocationStacFloatingActionButtonLocation?The location of the floating action button.
persistentFooterButtonsList<Map<String, dynamic>>?The persistent footer buttons of the scaffold.
drawerMap<String, dynamic>?The drawer widget of the scaffold.
endDrawerMap<String, dynamic>?The end drawer widget of the scaffold.
bottomNavigationBarMap<String, dynamic>?The bottom navigation bar widget of the scaffold.
bottomSheetMap<String, dynamic>?The bottom sheet widget of the scaffold.
backgroundColorString?The background color of the scaffold.
resizeToAvoidBottomInsetbool?Whether the scaffold should resize to avoid the bottom inset.
primaryboolWhether the scaffold is the primary scaffold. Defaults to true.
drawerDragStartBehaviorDragStartBehaviorThe 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.
drawerScrimColorString?The color of the scrim for the drawer.
drawerEdgeDragWidthdouble?The 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.
restorationIdString?The restoration ID to save and restore the state of the scaffold.

Example JSON​

{
"type": "scaffold",
"appBar": {
"type": "appBar",
"title": {
"type": "text",
"data": "App Bar Title"
}
},
"body": {
"type": "center",
"child": {
"type": "text",
"data": "Hello, World!"
}
},
"floatingActionButton": {
"type": "floatingActionButton",
"child": {
"type": "icon",
"icon": "add"
},
"onPressed": {
"type": "function",
"name": "onFabPressed"
}
},
"backgroundColor": "#FFFFFF",
"drawer": {
"type": "drawer",
"child": {
"type": "column",
"children": [
{
"type": "text",
"data": "Drawer Item 1"
},
{
"type": "text",
"data": "Drawer Item 2"
}
]
}
}
}