AppBar
A material design app bar displayed at the top of the screen, providing navigation, branding, and action items.Properties
Content
A control to display before the toolbar’s
title. Typically an Icon or IconButton control.Defines the width of the
leading control.Whether we should try to imply the
leading control if it is None.- If
TrueandleadingisNone, this app bar will automatically determine an appropriate leading control. - If
FalseandleadingisNone, the space is allocated to thetitle. - If a
leadingcontrol is provided, this parameter has no effect.
The primary Control displayed in this app bar. Typically a
Text control that contains a description of the current contents of this app.Note: If AppBar.adaptive=True and this app is opened on an iOS or macOS device, this title control will be automatically centered, independent of the value of center_title.Whether the
title should be centered. Default value is defined by AppBarTheme.center_title.A list of Controls to display in a row after the title control.Typically, these controls are
IconButtons representing common operations. For less common operations, consider using a PopupMenuButton as the last action.Info: If AppBar.adaptive is True and this app is opened on an iOS or macOS device, these actions will be automatically placed in a Row. This is because CupertinoAppBar.trailing (which is the counterpart property of actions) takes only a single Control.Styling
Defines the height of the toolbar component of this app bar.
The default color for
Text and Icon controls within this app bar. Default color is defined by AppBarTheme.color.The fill color to use for this app bar. Default color is defined by
AppBarTheme.bgcolor.The app bar’s elevation.Note: This effect is only visible when using the Material 2 design (when
Theme.use_material3 is False).Must be greater than or equal to 0.0.The elevation to be used if this app bar has something scrolled underneath it.Must be greater than or equal to
0.0.The color of the shadow below this app bar. A shadow is only visible and displayed if the
elevation is greater than zero.The shape of this app bar’s Material as well as its shadow.
Layout and Spacing
The spacing around
title on the horizontal axis. It is applied even if there are no leading or actions controls.Tip: If you want title to take all the space available, set title_spacing to 0.0.The padding between the
actions and the end of this app bar.Text Styles
The style to be used for the
Text controls in the title.The style to be used for the
Text controls in the app bar’s leading and actions.Behavior
The content will be clipped (or not) according to this option.
Forces this app bar to be transparent (instead of Material’s default type). This will also remove the visual display of
bgcolor and elevation, and affect other characteristics of this app bar.Whether this app bar is not being displayed at the top of the screen.
Whether the
title should be wrapped with header Semantics.The opacity of the toolbar. Value must be between
0.0 (transparent) and 1.0 (fully opaque) inclusive.Example
Adaptive Behavior
Whenadaptive=True, the AppBar automatically adapts to the platform:
- The
titleis automatically centered - Multiple
actionsare wrapped in aRow(since CupertinoAppBar only accepts a single trailing control)