@@ -6,6 +6,7 @@ import 'posthog_display_link_question.dart';
6
6
import 'posthog_display_rating_question.dart' ;
7
7
import 'posthog_display_choice_question.dart' ;
8
8
import 'posthog_display_survey_appearance.dart' ;
9
+ import 'posthog_display_survey_text_content_type.dart' ;
9
10
10
11
/// Main survey model containing metadata and questions
11
12
@immutable
@@ -18,6 +19,12 @@ class PostHogDisplaySurvey {
18
19
final question = q['question' ] as String ;
19
20
final optional = q['isOptional' ] as bool ;
20
21
final questionDescription = q['questionDescription' ] as String ? ;
22
+ // Extract content type values with fallback to text (1)
23
+ final questionContentTypeRaw =
24
+ q['questionDescriptionContentType' ] as int ? ?? 1 ;
25
+ final questionDescriptionContentType =
26
+ PostHogDisplaySurveyTextContentType .fromInt (questionContentTypeRaw);
27
+
21
28
final buttonText = q['buttonText' ] as String ? ;
22
29
23
30
switch (type) {
@@ -26,6 +33,7 @@ class PostHogDisplaySurvey {
26
33
question: question,
27
34
link: q['link' ] as String ,
28
35
description: questionDescription,
36
+ descriptionContentType: questionDescriptionContentType,
29
37
optional: optional,
30
38
buttonText: buttonText,
31
39
);
@@ -39,6 +47,7 @@ class PostHogDisplaySurvey {
39
47
lowerBoundLabel: q['lowerBoundLabel' ] as String ,
40
48
upperBoundLabel: q['upperBoundLabel' ] as String ,
41
49
description: questionDescription,
50
+ descriptionContentType: questionDescriptionContentType,
42
51
optional: optional,
43
52
buttonText: buttonText,
44
53
);
@@ -51,6 +60,7 @@ class PostHogDisplaySurvey {
51
60
hasOpenChoice: q['hasOpenChoice' ] as bool ,
52
61
shuffleOptions: q['shuffleOptions' ] as bool ,
53
62
description: questionDescription,
63
+ descriptionContentType: questionDescriptionContentType,
54
64
optional: optional,
55
65
buttonText: buttonText,
56
66
);
@@ -59,6 +69,7 @@ class PostHogDisplaySurvey {
59
69
return PostHogDisplayOpenQuestion (
60
70
question: question,
61
71
description: questionDescription,
72
+ descriptionContentType: questionDescriptionContentType,
62
73
optional: optional,
63
74
buttonText: buttonText,
64
75
);
@@ -68,6 +79,13 @@ class PostHogDisplaySurvey {
68
79
PostHogDisplaySurveyAppearance ? appearance;
69
80
if (dict['appearance' ] != null ) {
70
81
final a = Map <String , dynamic >.from (dict['appearance' ] as Map );
82
+
83
+ // Extract thank you message content type with fallback to text (1)
84
+ final thankYouContentTypeRaw =
85
+ a['thankYouMessageDescriptionContentType' ] as int ? ?? 1 ;
86
+ final thankYouMessageDescriptionContentType =
87
+ PostHogDisplaySurveyTextContentType .fromInt (thankYouContentTypeRaw);
88
+
71
89
appearance = PostHogDisplaySurveyAppearance (
72
90
fontFamily: a['fontFamily' ] as String ? ,
73
91
backgroundColor: a['backgroundColor' ] as String ? ,
@@ -82,6 +100,8 @@ class PostHogDisplaySurvey {
82
100
displayThankYouMessage: a['displayThankYouMessage' ] as bool ? ?? true ,
83
101
thankYouMessageHeader: a['thankYouMessageHeader' ] as String ? ,
84
102
thankYouMessageDescription: a['thankYouMessageDescription' ] as String ? ,
103
+ thankYouMessageDescriptionContentType:
104
+ thankYouMessageDescriptionContentType,
85
105
thankYouMessageCloseButtonText:
86
106
a['thankYouMessageCloseButtonText' ] as String ? ,
87
107
);
0 commit comments