M3EToolbar class

A Material 3 Expressive toolbar.

Mirrors Compose Material 3:

Floating expand:

Inheritance
Implemented types

Constructors

M3EToolbar({Widget? leading, Widget? title, String? titleText, Widget? subtitle, String? subtitleText, Widget? trailing, List<M3EToolbarItem> actions = const <M3EToolbarItem>[], int maxInlineActions = 4, Widget overflowIcon = const Icon(M3EIcons.more_vert), bool centerTitle = false, AlignmentGeometry alignment = Alignment.center, M3EToolbarColorStyle colorStyle = M3EToolbarColorStyle.standard, M3EToolbarVariant? variant, M3EToolbarSize size = M3EToolbarSize.medium, Axis axis = Axis.horizontal, bool expanded = true, ValueChanged<bool>? onExpandedChanged, Widget? floatingActionButton, Widget? fabIcon, Widget? fabExpandIcon, Widget? fabCollapseIcon, VoidCallback? onFabPressed, M3EToolbarFabPosition fabPosition = M3EToolbarFabPosition.end, M3EToolbarDockEdge dockEdge = M3EToolbarDockEdge.bottom, Color? backgroundColor, Color? foregroundColor, double? elevation, EdgeInsetsGeometry? padding, bool safeArea = false, Clip clipBehavior = Clip.none, String? semanticLabel, M3EToolbarVisibilityController? visibilityController, M3EToolbarScrollBehavior? scrollBehavior, double? exitExtent, int? activeIndex, ValueChanged<int>? onActiveIndexChanged, Key? key})
Floating toolbar (default). Horizontal unless axis is vertical.
const
M3EToolbar.docked({Widget? leading, Widget? title, String? titleText, Widget? subtitle, String? subtitleText, Widget? trailing, List<M3EToolbarItem> actions = const <M3EToolbarItem>[], int maxInlineActions = 4, Widget overflowIcon = const Icon(M3EIcons.more_vert), bool centerTitle = false, M3EToolbarColorStyle colorStyle = M3EToolbarColorStyle.standard, M3EToolbarVariant? variant, M3EToolbarSize size = M3EToolbarSize.medium, M3EToolbarDockEdge dockEdge = M3EToolbarDockEdge.bottom, Color? backgroundColor, Color? foregroundColor, double? elevation, EdgeInsetsGeometry? padding, bool safeArea = true, Clip clipBehavior = Clip.none, String? semanticLabel, M3EToolbarVisibilityController? visibilityController, M3EToolbarScrollBehavior? scrollBehavior, double? exitExtent, int? activeIndex, ValueChanged<int>? onActiveIndexChanged, Key? key})
Docked full-bleed bar (Compose FlexibleBottomAppBar).
const
M3EToolbar.floating({Widget? leading, Widget? title, String? titleText, Widget? subtitle, String? subtitleText, Widget? trailing, List<M3EToolbarItem> actions = const <M3EToolbarItem>[], int maxInlineActions = 4, Widget overflowIcon = const Icon(M3EIcons.more_vert), bool centerTitle = false, AlignmentGeometry alignment = Alignment.center, M3EToolbarColorStyle colorStyle = M3EToolbarColorStyle.standard, M3EToolbarVariant? variant, M3EToolbarSize size = M3EToolbarSize.medium, Axis axis = Axis.horizontal, bool expanded = true, ValueChanged<bool>? onExpandedChanged, Widget? floatingActionButton, Widget? fabIcon, Widget? fabExpandIcon, Widget? fabCollapseIcon, VoidCallback? onFabPressed, M3EToolbarFabPosition fabPosition = M3EToolbarFabPosition.end, M3EToolbarDockEdge dockEdge = M3EToolbarDockEdge.bottom, Color? backgroundColor, Color? foregroundColor, double? elevation, EdgeInsetsGeometry? padding, bool safeArea = false, Clip clipBehavior = Clip.none, String? semanticLabel, M3EToolbarVisibilityController? visibilityController, M3EToolbarScrollBehavior? scrollBehavior, double? exitExtent, int? activeIndex, ValueChanged<int>? onActiveIndexChanged, Key? key})
Explicit floating constructor (same as default).
const

Properties

actions List<M3EToolbarItem>
actions.
final
activeIndex int?
Optional seed / external sync for the active action index.
final
alignment AlignmentGeometry
Positions a floating toolbar within its parent. Ignored when docked.
final
axis Axis
axis.
final
backgroundColor Color?
backgroundColor.
final
centerTitle bool
centerTitle.
final
clipBehavior Clip
clipBehavior.
final
colorStyle M3EToolbarColorStyle
colorStyle.
final
dockEdge M3EToolbarDockEdge
dockEdge.
final
elevation double?
elevation.
final
exitExtent double?
Overrides measured exit distance when non-null.
final
expanded bool
Expand state for floating toolbars with a FAB or expand trigger.
final
fabCollapseIcon Widget?
Icon shown on the default FAB when the toolbar is expanded.
final
fabExpandIcon Widget?
Icon shown on the default FAB when the toolbar is collapsed.
final
fabIcon Widget?
Expand-state FAB icon fallback / opt-in for the default adjacent FAB.
final
fabPosition M3EToolbarFabPosition
fabPosition.
final
floatingActionButton Widget?
floatingActionButton.
final
foregroundColor Color?
foregroundColor.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leading Widget?
leading.
final
maxInlineActions int
maxInlineActions.
final
onActiveIndexChanged ValueChanged<int>?
Enables toolbar-owned selection and notifies when the active index changes.
final
onExpandedChanged ValueChanged<bool>?
Called whenever the expand state changes.
final
onFabPressed VoidCallback?
Called when the FAB is pressed. When null and a default FAB is built, the FAB toggles whole-pill expand. When set, it is invoked in addition to the expand toggle (for default FAB) or alone (custom floatingActionButton that does not wire expand — keep expanded true for always-open pill).
final
overflowIcon Widget
overflowIcon.
final
padding EdgeInsetsGeometry?
padding.
final
placement M3EToolbarPlacement
placement.
final
preferredSize Size
The size this widget would prefer if it were otherwise unconstrained.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeArea bool
safeArea.
final
scrollBehavior M3EToolbarScrollBehavior?
Optional scroll-exit behavior. Default null = no scroll detection.
final
semanticLabel String?
semanticLabel.
final
size M3EToolbarSize
size.
final
subtitle Widget?
subtitle.
final
subtitleText String?
subtitleText.
final
title Widget?
title.
final
titleText String?
titleText.
final
trailing Widget?
trailing.
final
variant M3EToolbarVariant?
Legacy variant; when set, overrides colorStyle.
final
visibilityController M3EToolbarVisibilityController?
Optional manual visibility controller (show / hide / toggle).
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<M3EToolbar>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent 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 DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited