FormMessage constructor
FormMessage({
- required List<
ElementEntity> formFields, - required ButtonElement submitElement,
- required String title,
- dynamic tags,
- int? id,
- String? muid,
- User? sender,
- AppEntity? receiver,
- required String receiverUid,
- String type = MessageTypeConstants.form,
- required String receiverType,
- String? category = MessageCategoryConstants.interactive,
- DateTime? sentAt,
- DateTime? deliveredAt,
- DateTime? readAt,
- Map<
String, dynamic> ? metadata, - DateTime? readByMeAt,
- DateTime? deliveredToMeAt,
- DateTime? deletedAt,
- DateTime? editedAt,
- String? deletedBy,
- String? editedBy,
- DateTime? updatedAt,
- String? conversationId,
- int? parentMessageId,
- int? replyCount,
- String? goalCompletionText,
- required InteractionGoal? interactionGoal,
- List<
Interaction> ? interactions, - bool? allowSenderInteraction,
Creates a new FormMessage instance.
The formFields
represent the list of form fields within the message.
The submitElement
is the button element used for form submission.
The title
is the title of the form message.
The rest of the parameters are optional and are inherited from InteractiveMessage.
Implementation
FormMessage(
{required this.formFields,
required this.submitElement,
required this.title,
tags,
int? id,
String? muid,
super.sender,
super.receiver,
required super.receiverUid,
super.type = MessageTypeConstants.form,
required super.receiverType,
String? category = MessageCategoryConstants.interactive,
super.sentAt,
super.deliveredAt,
super.readAt,
super.metadata,
super.readByMeAt,
super.deliveredToMeAt,
super.deletedAt,
super.editedAt,
super.deletedBy,
super.editedBy,
super.updatedAt,
super.conversationId,
int? parentMessageId,
int? replyCount,
this.goalCompletionText,
required super.interactionGoal,
super.interactions,
bool? allowSenderInteraction})
: super(
id: id ?? 0,
muid: muid ?? '',
parentMessageId: parentMessageId ?? 0,
replyCount: replyCount ?? 0,
allowSenderInteraction: allowSenderInteraction ?? false,
interactiveData: {
// ModelColumns.formFields : formFields.map((e) => e.toMap()).toList(),
// ModelColumns.submitElement : submitElement.toMap(),
// ModelColumns.title : title,
});