build method
Builds the final widget for this display mode for this item. Sub-classes implement this to build the widget that is appropriate for the given display mode (in toolbar or overflowed).
Implementation
@override
Widget build(BuildContext context, ToolbarItemDisplayMode displayMode) {
if (displayMode == ToolbarItemDisplayMode.inToolbar) {
Widget widget = inToolbarBuilder(context);
if (tooltipMessage != null) {
widget = MacosTooltip(
message: tooltipMessage!,
child: widget,
);
}
return widget;
} else {
return (inOverflowedBuilder != null)
? inOverflowedBuilder!(context)
: const SizedBox.shrink();
}
}