@@ -5,54 +5,85 @@ import 'posthog_display_survey_appearance.dart';
55@immutable
66class SurveyAppearance {
77 const SurveyAppearance ({
8- this .backgroundColor,
8+ this .backgroundColor = Colors .white ,
99 this .submitButtonColor = Colors .black,
1010 this .submitButtonText = 'Submit' ,
1111 this .submitButtonTextColor = Colors .white,
12- this .descriptionTextColor,
13- this .ratingButtonColor,
14- this .ratingButtonActiveColor,
12+ this .descriptionTextColor = Colors .black,
13+ this .questionTextColor = Colors .black,
14+ this .closeButtonColor = Colors .black,
15+ this .ratingButtonColor = const Color (0xFFEEEEEE ),
16+ this .ratingButtonActiveColor = Colors .black,
17+ this .ratingButtonSelectedTextColor = Colors .white,
18+ this .ratingButtonUnselectedTextColor = const Color (0x80000000 ),
1519 this .displayThankYouMessage = true ,
1620 this .thankYouMessageHeader = 'Thank you for your feedback!' ,
1721 this .thankYouMessageDescription,
1822 this .thankYouMessageCloseButtonText = 'Close' ,
19- this .borderColor,
23+ this .borderColor = const Color (0xFFBDBDBD ),
24+ this .inputBackgroundColor = Colors .white,
25+ this .inputTextColor = Colors .black,
26+ this .inputPlaceholderColor = const Color (0xFF757575 ),
27+ this .choiceButtonBorderColor = Colors .black,
28+ this .choiceButtonTextColor = Colors .black,
2029 });
2130
22- final Color ? backgroundColor;
31+ final Color backgroundColor;
2332 final Color submitButtonColor;
2433 final String submitButtonText;
2534 final Color submitButtonTextColor;
26- final Color ? descriptionTextColor;
27- final Color ? ratingButtonColor;
28- final Color ? ratingButtonActiveColor;
35+ final Color descriptionTextColor;
36+ final Color questionTextColor;
37+ final Color closeButtonColor;
38+ final Color ratingButtonColor;
39+ final Color ratingButtonActiveColor;
40+ final Color ratingButtonSelectedTextColor;
41+ final Color ratingButtonUnselectedTextColor;
2942 final bool displayThankYouMessage;
3043 final String thankYouMessageHeader;
3144 final String ? thankYouMessageDescription;
3245 final String thankYouMessageCloseButtonText;
33- final Color ? borderColor;
46+ final Color borderColor;
47+ final Color inputBackgroundColor;
48+ final Color inputTextColor;
49+ final Color inputPlaceholderColor;
50+ final Color choiceButtonBorderColor;
51+ final Color choiceButtonTextColor;
3452
3553 /// Creates a [SurveyAppearance] from a [PostHogDisplaySurveyAppearance]
3654 static SurveyAppearance fromPostHog (
3755 PostHogDisplaySurveyAppearance ? appearance) {
3856 return SurveyAppearance (
39- backgroundColor: _colorFromHex (appearance? .backgroundColor),
57+ backgroundColor:
58+ _colorFromHex (appearance? .backgroundColor) ?? Colors .white,
4059 submitButtonColor:
4160 _colorFromHex (appearance? .submitButtonColor) ?? Colors .black,
4261 submitButtonText: appearance? .submitButtonText ?? 'Submit' ,
4362 submitButtonTextColor:
4463 _colorFromHex (appearance? .submitButtonTextColor) ?? Colors .white,
45- descriptionTextColor: _colorFromHex (appearance? .descriptionTextColor),
46- ratingButtonColor: _colorFromHex (appearance? .ratingButtonColor),
64+ descriptionTextColor:
65+ _colorFromHex (appearance? .descriptionTextColor) ?? Colors .black,
66+ questionTextColor: Colors .black,
67+ closeButtonColor: Colors .black,
68+ ratingButtonColor: _colorFromHex (appearance? .ratingButtonColor) ??
69+ const Color (0xFFEEEEEE ),
4770 ratingButtonActiveColor:
48- _colorFromHex (appearance? .ratingButtonActiveColor),
71+ _colorFromHex (appearance? .ratingButtonActiveColor) ?? Colors .black,
72+ ratingButtonSelectedTextColor: Colors .white,
73+ ratingButtonUnselectedTextColor: const Color (0x80000000 ),
4974 displayThankYouMessage: appearance? .displayThankYouMessage ?? true ,
5075 thankYouMessageHeader:
5176 appearance? .thankYouMessageHeader ?? 'Thank you for your feedback!' ,
5277 thankYouMessageDescription: appearance? .thankYouMessageDescription,
5378 thankYouMessageCloseButtonText:
5479 appearance? .thankYouMessageCloseButtonText ?? 'Close' ,
55- borderColor: _colorFromHex (appearance? .borderColor),
80+ borderColor:
81+ _colorFromHex (appearance? .borderColor) ?? const Color (0xFFBDBDBD ),
82+ inputBackgroundColor: Colors .white,
83+ inputTextColor: Colors .black,
84+ inputPlaceholderColor: const Color (0xFF757575 ),
85+ choiceButtonBorderColor: Colors .black,
86+ choiceButtonTextColor: Colors .black,
5687 );
5788 }
5889
0 commit comments