buildSwitchFieldMenuOptions method

  1. @protected
List<PopupMenuItem<FastAmountSwitchFieldType>> buildSwitchFieldMenuOptions()

Implementation

@protected
List<PopupMenuItem<FastAmountSwitchFieldType>> buildSwitchFieldMenuOptions() {
  final options = <PopupMenuItem<FastAmountSwitchFieldType>>[];

  // Dynamically add menu items based on available options
  if (availableMenuOptions.contains(FastAmountSwitchMenuOption.amount)) {
    options.add(PopupMenuItem(
      value: FastAmountSwitchFieldType.amount,
      child: FastSecondaryBody(text: _getAmountMenuLabel()),
    ));
  }

  if (availableMenuOptions.contains(FastAmountSwitchMenuOption.percent)) {
    options.add(PopupMenuItem(
      value: FastAmountSwitchFieldType.percent,
      child: FastSecondaryBody(text: _getPercentMenuLabel()),
    ));
  }

  return options;
}