Implements the basic material design visual layout structure.

This class provides APIs for showing drawers, snack bars, and bottom sheets.

To display a snackbar or a persistent bottom sheet, obtain the ScaffoldState for the current BuildContext via Scaffold.of and use the ScaffoldState.showSnackBar and ScaffoldState.showBottomSheet functions.

See also:

  • AppBar, which is a horizontal bar typically shown at the top of an app using the appBar property.
  • FloatingActionButton, which is a circular button typically shown in the bottom right corner of the app using the floatingActionButton property.
  • Drawer, which is a vertical panel that is typically displayed to the left of the body (and often hidden on phones) using the drawer property.
  • BottomNavigationBar, which is a horizontal array of buttons typically shown along the bottom of the app using the bottomNavigationBar property.
  • SnackBar, which is a temporary notification typically shown near the bottom of the app using the ScaffoldState.showSnackBar method.
  • BottomSheet, which is an overlay typically shown near the bottom of the app. A bottom sheet can either be persistent, in which case it is shown using the ScaffoldState.showBottomSheet method, or modal, in which case it is shown using the showModalBottomSheet function.
  • ScaffoldState, which is the state associated with this widget.
  • material.google.com/layout/structure.html
Inheritance

Static Methods

hasDrawer(BuildContext context, { bool registerForUpdates: true }) bool

Whether the Scaffold that most tightly encloses the given context has a drawer.

of(BuildContext context, { bool nullOk: false }) ScaffoldState

The state from the closest instance of this class that encloses the given context.

Constructors

Scaffold({Key key, AppBar appBar, Widget body, Widget floatingActionButton, List<Widget> persistentFooterButtons, Widget drawer, Widget bottomNavigationBar, Color backgroundColor, bool resizeToAvoidBottomPadding: true })

Creates a visual scaffold for material design widgets.

Properties

appBar AppBar

An app bar to display at the top of the scaffold.

final
backgroundColor Color

The color of the Material widget that underlies the entire Scaffold.

final
body Widget

The primary content of the scaffold.

final
bottomNavigationBar Widget

A bottom navigation bar to display at the bottom of the scaffold.

final
drawer Widget

A panel displayed to the side of the body, often hidden on mobile devices.

final
floatingActionButton Widget

A button displayed floating above body, in the bottom right corner.

final
persistentFooterButtons List<Widget>

A set of buttons that are displayed at the bottom of the scaffold.

final
resizeToAvoidBottomPadding bool

Whether the body (and other floating widgets) should size themselves to avoid the window's bottom padding.

final
hashCode int

Get a hash code for this object.

read-only, inherited
key Key

Controls how one widget replaces another widget in the tree.

final, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

createState() ScaffoldState

Creates the mutable state for this widget at a given location in the tree.

createElement() StatefulElement

Creates a StatefulElement to manage this widget's location in the tree.

inherited
debugFillDescription(List<String> description) → void

Add additional information to the given description for use by toString.

mustCallSuper, protected, inherited
noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() String

Returns a string representation of this object.

inherited
toStringShort() String

A short, textual description of this widget.

inherited