createButtonMessage static method
Creates a button-based interactive message.
recipient is the recipient's phone number.
bodyText is the main message text.
buttons is the list of buttons to display.
headerText is optional text for the header.
footerText is optional text for the footer.
Implementation
static InteractiveMessage createButtonMessage({
required String recipient,
required String bodyText,
required List<Button> buttons,
String? headerText,
String? footerText,
}) {
return InteractiveMessage(
recipient: recipient,
interactiveType: InteractiveType.button,
body: BodyComponent(text: bodyText),
action: ButtonActionComponent(buttons: buttons),
header: headerText != null ? HeaderComponent(text: headerText) : null,
footer: footerText != null ? FooterComponent(text: footerText) : null,
);
}