FormMessage constructor

FormMessage({
  1. required List<ElementEntity> formFields,
  2. required ButtonElement submitElement,
  3. required String title,
  4. dynamic tags,
  5. int? id,
  6. String? muid,
  7. User? sender,
  8. AppEntity? receiver,
  9. required String receiverUid,
  10. String type = MessageTypeConstants.form,
  11. required String receiverType,
  12. String? category = MessageCategoryConstants.interactive,
  13. DateTime? sentAt,
  14. DateTime? deliveredAt,
  15. DateTime? readAt,
  16. Map<String, dynamic>? metadata,
  17. DateTime? readByMeAt,
  18. DateTime? deliveredToMeAt,
  19. DateTime? deletedAt,
  20. DateTime? editedAt,
  21. String? deletedBy,
  22. String? editedBy,
  23. DateTime? updatedAt,
  24. String? conversationId,
  25. int? parentMessageId,
  26. int? replyCount,
  27. String? goalCompletionText,
  28. required InteractionGoal? interactionGoal,
  29. List<Interaction>? interactions,
  30. 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,
          });