A material design app bar.

An app bar consists of a toolbar and potentially other widgets, such as a TabBar and a FlexibleSpaceBar. App bars typically expose one or more common actions with IconButtons which are optionally followed by a PopupMenuButton for less common operations.

App bars are typically used in the Scaffold.appBar property, which places the app bar as a fixed-height widget at the top of the screen. For a scrollable app bar, see SliverAppBar, which embeds an AppBar in a sliver for use in a CustomScrollView.

The AppBar displays the toolbar widgets, leading, title, and actions, above the bottom (if any). If a flexibleSpace widget is specified then it is stacked behind the toolbar and the bottom widget.

See also:

Inheritance

Constructors

AppBar({Key key, Widget leading, Widget title, List<Widget> actions, Widget flexibleSpace, AppBarBottomWidget bottom, int elevation: 4, Color backgroundColor, Brightness brightness, IconThemeData iconTheme, TextTheme textTheme, bool primary: true, bool centerTitle, double toolbarOpacity: 1.0, double bottomOpacity: 1.0 })

Creates a material design app bar.

Properties

actions List<Widget>

Widgets to display after the title widget.

final
backgroundColor Color

The color to use for the app bar's material. Typically this should be set along with brightness, iconTheme, textTheme.

final
bottom AppBarBottomWidget

This widget appears across the bottom of the app bar.

final
bottomOpacity double

How opaque the bottom part of the app bar is.

final
brightness Brightness

The brightness of the app bar's material. Typically this is set along with backgroundColor, iconTheme, textTheme.

final
centerTitle bool

Whether the title should be centered.

final
elevation int

The z-coordinate at which to place this app bar.

final
flexibleSpace Widget

This widget is stacked behind the toolbar and the tabbar. It's height will be the same as the the app bar's overall height.

final
iconTheme IconThemeData

The color, opacity, and size to use for app bar icons. Typically this is set along with backgroundColor, brightness, textTheme.

final
leading Widget

A widget to display before the title.

final
minExtent double

The height of the toolbar and the bottom widget.

read-only
primary bool

Whether this app bar is being displayed at the top of the screen.

final
textTheme TextTheme

The typographic styles to use for text in the app bar. Typically this is set along with brightness backgroundColor, iconTheme.

final
title Widget

The primary widget displayed in the appbar.

final
toolbarOpacity double

How opaque the toolbar part of the app bar is.

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() → _AppBarState

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