toJson method

  1. @override
Map<String, dynamic> toJson()
override

Generates a map representing the InteractiveMessage.

Implementation

@override
Map<String, dynamic> toJson() {
  Map<String, dynamic> map = super.toJson();
  map[ModelFieldConstants.title] = title;
  map[ModelFieldConstants.submitElement] = submitElement.toMap();
  map[ModelFieldConstants.formFields] =
      formFields.map((e) => e.toMap()).toList();
  if (goalCompletionText != null) {
    map[ModelFieldConstants.goalCompletionText] = goalCompletionText;
  }

  return map;
}