getDefaultOptionsWithCallback static method
List<CometChatOption> ?
getDefaultOptionsWithCallback({
- required Conversation conversation,
- required BuildContext context,
- required CometChatColorPalette colorPalette,
- required dynamic onDelete()?,
Get default options for a conversation with custom delete callback
This is the new recommended way to get default conversation options.
Provide a custom onDelete callback to handle deletion.
Implementation
static List<CometChatOption>? getDefaultOptionsWithCallback({
required Conversation conversation,
required BuildContext context,
required CometChatColorPalette colorPalette,
required Function(Conversation)? onDelete,
}) {
return [
CometChatOption(
id: ConversationOptionConstants.delete,
icon: AssetConstants.delete,
packageName: UIConstants.packageName,
backgroundColor: colorPalette.background1,
iconTint: colorPalette.error,
title: Translations.of(context).delete,
onClick: () {
if (onDelete != null) {
onDelete(conversation);
}
},
),
];
}