KeyHintBar class

A one-line bar listing the labeled key bindings active for the current focus, as [key] label · [key] label. It updates when focus moves.

When the width runs out, it shows as many whole hints as fit and collapses the rest into a trailing +N, rather than clipping a label mid-word or silently dropping hints. The deepest (most local) bindings come first, so the outermost ones are the first to collapse. A binding with aliases (KeyBinding(↑, aliases: [↓], …)) shows a combined key: [↑↓] move.

A binding appears only when it has a label, does not set hideFromHintBar: true, and is enabled. When two scopes bind the same key, the nearer (deeper) binding is shown. While focus is in a dialog shown with context.present, or inside any other KeyBindings(modal: true), the bindings outside it aren't shown: keys don't reach them.

Inheritance
Available extensions

Constructors

KeyHintBar({Key? key, int maxBindings = 12, String separator = ' · ', CellStyle style = CellStyle.none, CellStyle? keyStyle})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
key → Key?
finalinherited
keyStyle → CellStyle?
Style for the [key chord] portion of each hint, so the chord reads distinctly from its description. Defaults to the theme's focus color in bold, layered on style.
final
maxBindings → int
Hard cap on how many bindings are considered, applied before width fitting. Anything past the fitted width or this cap collapses into a trailing +N — so extra bindings degrade visibly rather than vanishing.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
separator → String
Separator between bindings. Default: ' · '.
final
style → CellStyle
Style applied to the description text (and separators / +N marker).
final

Methods

animate({Duration? duration, Curve? curve, Object? trigger, bool repeat = false}) → Animate

Available on Widget, provided by the AnimateExtension extension

Starts an Animate chain over this widget. duration / curve apply to the whole chain. With no trigger it plays on mount; with a non-null trigger it rests on mount and replays whenever the token changes.
build(BuildContext context) → Widget
Describes the part of the user interface represented by this widget.
override
createElement() → StatelessElement
Creates the Element that will mount this widget into the tree.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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