CommandBar class
Command bars provide quick access to common tasks. This could be application-level or page-level commands.
A command bar is composed of a series of CommandBarItems, which each could be a CommandBarButton or a custom CommandBarItem.
If there is not enough horizontal space to display all items, the overflow behavior is determined by overflowBehavior.
See also:
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- CommandBar
- Available Extensions
Constructors
-
CommandBar({Key? key, required List<
CommandBarItem> primaryItems, List<CommandBarItem> secondaryItems = const [], CommandBarActionItemBuilder? overflowItemBuilder, CommandBarOverflowBehavior overflowBehavior = CommandBarOverflowBehavior.dynamicOverflow, double? compactBreakpointWidth, bool? isCompact, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment? crossAxisAlignment, MainAxisAlignment overflowItemAlignment = MainAxisAlignment.end, Axis direction = Axis.horizontal}) -
Creates a command bar.
const
Properties
- compactBreakpointWidth → double?
-
If the width of this widget is less then the indicated amount,
items in the primary area will be rendered using
CommandBarItemDisplayMode.inPrimaryCompact. If this is
null
or the width of this widget is wider, then the items will be rendered using CommandBarItemDisplayMode.inPrimary.final - crossAxisAlignment → CrossAxisAlignment
-
The alignment of the items within the command bar across the cross axis
final
- direction → Axis
-
The direction of the command bar. The default is Axis.horizontal.
If direction is Axis.vertical, we recomment setting isCompact to true,
and crossAxisAlignment to CrossAxisAlignment.start.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCompact → bool?
-
If compactBreakpointWidth is
null
, then specifies whether or not primary items should be displayed in compact mode (CommandBarItemDisplayMode.inPrimaryCompact) or normal mode CommandBarItemDisplayMode.inPrimary.final - key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mainAxisAlignment → MainAxisAlignment
-
The alignment of the items within the command bar across the main axis
final
- overflowBehavior → CommandBarOverflowBehavior
-
Determines what should happen when the items are too wide for the
primary command bar area. See CommandBarOverflowBehavior.
final
- overflowItemAlignment → MainAxisAlignment
-
The alignment of the overflow item (if displayed) between the end of
the visible primary items and the end of the boundaries of this widget.
Only relevant if overflowBehavior is
CommandBarOverflowBehavior.dynamicOverflow.
final
- overflowItemBuilder → CommandBarActionItemBuilder?
-
Allows customization of the "overflow item" that will appear on the
primary area of the command bar if there are any items in the
secondaryItems (including any items that are dynamically considered
to be there if overflowBehavior is
CommandBarOverflowBehavior.dynamicOverflow.)
final
-
primaryItems
→ List<
CommandBarItem> -
The
CommandBarItem
s that should appear on the primary area.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
secondaryItems
→ List<
CommandBarItem> -
If non-empty, a "overflow item" will appear on the primary area
(as built by overflowItemBuilder, or it will be a "more" button
if overflowItemBuilder is null), and when activated, will show a
flyout containing this list of secondary items.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< CommandBar> -
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}) → 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