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:

Inheritance

Constructors

Scaffold({Key key, PreferredSizeWidget appBar, Widget body, Widget floatingActionButton, List<Widget> persistentFooterButtons, Widget drawer, Widget bottomNavigationBar, Color backgroundColor, bool resizeToAvoidBottomPadding: true, bool primary: true })
Creates a visual scaffold for material design widgets.
const

Properties

appBar PreferredSizeWidget
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
primary bool
Whether this scaffold is being displayed at the top of the screen. [...]
final
resizeToAvoidBottomPadding bool
Whether the body (and other floating widgets) should size themselves to avoid the window's bottom padding. [...]
final
hashCode int
The 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

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
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder description) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toDiagnosticsNode({String name, DiagnosticsTreeStyle style }) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by toStringDeep. [...]
inherited
toString() String
Returns a string representation of this object.
inherited
toStringDeep([String prefixLineOne = '', String prefixOtherLines ]) String
Returns a string representation of this node and its descendants. [...]
inherited
toStringShallow([String joiner = ', ' ]) String
Returns a one-line detailed description of the object. [...]
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(other) bool
The equality operator. [...]
inherited

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. [...]