MenuAcceleratorChildBuilder typedef
The type of builder function used for building a MenuAcceleratorLabel's MenuAcceleratorLabel.builder function.
The arguments to the function are as follows:
- The
context
supplies the BuildContext to use. - The
label
is the MenuAcceleratorLabel.label attribute for the relevant MenuAcceleratorLabel with the accelerator markers stripped out of it. - The
index
is the index of the accelerator character within thelabel.characters
that applies to this accelerator. If it is -1, then the accelerator should not be highlighted. Otherwise, the given character should be highlighted somehow in the rendered label (typically with an underscore). Importantly,index
is not an index into the Stringlabel
, it is an index into the Characters iterable returned bylabel.characters
, so that it is in terms of user-visible characters (a.k.a. grapheme clusters), not Unicode code points.
See also:
- MenuAcceleratorLabel.defaultLabelBuilder, which is the implementation used as the default value for MenuAcceleratorLabel.builder.
Implementation
typedef MenuAcceleratorChildBuilder = Widget Function(
BuildContext context,
String label,
int index,
);