Skip to main content

Drawer

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

Properties

PropertyTypeDescription
backgroundColorString?The background color of the drawer.
elevationdouble?The z-coordinate at which to place this drawer.
shadowColorString?The color of the drawer’s shadow.
surfaceTintColorString?The surface tint color of the drawer.
shapeStacShapeBorder?The shape of the drawer.
widthdouble?The width of the drawer.
childMap<String, dynamic>?The widget below this widget in the tree.
semanticLabelString?The semantic label for the drawer.
clipBehaviorClip?The clip behavior of the drawer.

Example JSON

{
  "type": "drawer",
  "backgroundColor": "#FFFFFF",
  "elevation": 16.0,
  "shadowColor": "#000000",
  "surfaceTintColor": "#F2F2F2",
  "shape": {
    "type": "roundedRectangleBorder",
    "borderRadius": 16
  },
  "width": 304.0,
  "semanticLabel": "Navigation Drawer",
  "clipBehavior": "antiAlias",
  "child": {
    "type": "column",
    "children": [
      {
        "type": "text",
        "data": "Drawer Header"
      },
      {
        "type": "text",
        "data": "Item 1"
      },
      {
        "type": "text",
        "data": "Item 2"
      }
    ]
  }
}
I