buildGotoSourceMenuItems function
- required List<
RohdSourceFormat> formats, - int count = 1,
- double height = 32,
- TextStyle? textStyle,
- bool showIcons = true,
- SourceFormatIconBuilder iconBuilder = sourceFormatMenuIcon,
Build Go to <format> Source popup-menu items for formats.
Each item carries a value encoded by gotoSourceMenuValue; decode the chosen value with gotoSourceFormatFromValue in the menu's result handler.
Implementation
List<PopupMenuItem<String>> buildGotoSourceMenuItems({
required List<RohdSourceFormat> formats,
int count = 1,
double height = 32,
TextStyle? textStyle,
bool showIcons = true,
SourceFormatIconBuilder iconBuilder = sourceFormatMenuIcon,
}) =>
[
for (final format in formats)
buildRohdPopupMenuItem<String>(
value: gotoSourceMenuValue(format),
height: height,
icon: showIcons ? iconBuilder(format) : const SizedBox.shrink(),
label: gotoSourceMenuLabel(format, count: count),
textStyle: textStyle,
),
];