getPopUpMenuButtons method

dynamic getPopUpMenuButtons(
  1. List<CometChatOption> menuItems,
  2. CometChatTheme theme
)

Implementation

getPopUpMenuButtons(List<CometChatOption> menuItems, CometChatTheme theme) {
  return PopupMenuButton<CometChatOption>(
    itemBuilder: (context) => menuItems
        .map((item) => PopupMenuItem<CometChatOption>(
              value: item,
              child: Text(
                item.title ?? "",
                style: TextStyle(color: theme.palette.getAccent())
                    .merge(item.titleStyle),
              ),
            ))
        .toList(),
    onSelected: (CometChatOption option) {
      performOnClick(option);
    },
    color: theme.palette.mode == PaletteThemeModes.light
        ? theme.palette.getBackground()
        : Color.alphaBlend(
            theme.palette.getAccent200(), theme.palette.getBackground()),
    icon: Icon(
      Icons.adaptive.more,
      color: theme.palette.getAccent(),
    ),
  );
}