buildTextAndBackgroundColorMobileToolbarItem function

MobileToolbarItem buildTextAndBackgroundColorMobileToolbarItem({
  1. List<ColorOption>? textColorOptions,
  2. List<ColorOption>? backgroundColorOptions,
})

Implementation

MobileToolbarItem buildTextAndBackgroundColorMobileToolbarItem({
  List<ColorOption>? textColorOptions,
  List<ColorOption>? backgroundColorOptions,
}) {
  return MobileToolbarItem.withMenu(
    itemIconBuilder: (context, __, ___) => AFMobileIcon(
      afMobileIcons: AFMobileIcons.color,
      color: MobileToolbarTheme.of(context).iconColor,
    ),
    itemMenuBuilder: (_, editorState, ___) {
      final selection = editorState.selection;
      if (selection == null) {
        return const SizedBox.shrink();
      }
      return _TextAndBackgroundColorMenu(
        editorState,
        selection,
        textColorOptions: textColorOptions,
        backgroundColorOptions: backgroundColorOptions,
      );
    },
  );
}