showMessageOptionSheet function

Future<ActionItem?> showMessageOptionSheet({
  1. required BuildContext context,
  2. required List<ActionItem> actionItems,
  3. Color? backgroundColor,
  4. String? title,
  5. TextStyle? titleStyle,
  6. ShapeBorder? alertShapeBorder,
  7. CometChatTheme? theme,
  8. required dynamic message,
  9. required CometChatMessageListController state,
  10. dynamic onReactionTap(
    1. BaseMessage,
    2. String?
    )?,
  11. Widget? addReactionIcon,
  12. dynamic addReactionIconTap(
    1. BaseMessage
    )?,
  13. bool hideReactions = false,
  14. List<String>? favoriteReactions,
})

Function to show message option bottom sheet

Implementation

Future<ActionItem?> showMessageOptionSheet(
    {required BuildContext context,
    required List<ActionItem> actionItems,
    final Color? backgroundColor,
    final String? title,
    final TextStyle? titleStyle,
    final ShapeBorder? alertShapeBorder,
    final CometChatTheme? theme,
    required final dynamic message,
    required final CometChatMessageListController state,
    final Function(BaseMessage, String?)? onReactionTap,
    final Widget? addReactionIcon,
    final Function(BaseMessage)? addReactionIconTap,
    bool hideReactions = false,
    List<String>? favoriteReactions}) {
  return showModalBottomSheet<ActionItem>(
      context: context,
      isScrollControlled: true,
      isDismissible: true,
      // shape: alertShapeBorder ??
      //     const RoundedRectangleBorder(
      //         borderRadius: BorderRadius.vertical(top: Radius.circular(16))),
      builder: (BuildContext context) => Container(
        decoration: const BoxDecoration(
          gradient: AppTheme.gradient,
          borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
        ),
        child: MessageOptionSheet(
            messageObject: message,
            actionItems: actionItems,
            backgroundColor: Colors.transparent,
            title: title,
            titleStyle: titleStyle,
            data: message,
            state: state,
            theme: theme,
            addReactionIcon: addReactionIcon,
            onAddReactionIconTap: addReactionIconTap,
            hideReactions: hideReactions,
            favoriteReactions: favoriteReactions,
            onReactionTap: onReactionTap,
          )
      ));
}