|
| 1 | +import 'package:flutter/material.dart'; |
| 2 | +import 'package:survey_sdk/survey_sdk.dart'; |
| 3 | + |
| 4 | +const _titleSize = 18.0; |
| 5 | +const _subtitleSize = 15.0; |
| 6 | +const _buttonTextSize = 14.0; |
| 7 | +const _buttonRadius = 12.0; |
| 8 | +const _horizontalPadding = 15.0; |
| 9 | +const _verticalPadding = 15.0; |
| 10 | +const _thumbRadius = 14.0; |
| 11 | +const _thickness = 10.0; |
| 12 | + |
| 13 | +abstract class MockedEntities { |
| 14 | + static const choice1 = ChoiceQuestionData( |
| 15 | + isMultipleChoice: true, |
| 16 | + options: ['option 1', 'option 2', 'option 3'], |
| 17 | + index: 0, |
| 18 | + title: 'title', |
| 19 | + subtitle: 'subtitle', |
| 20 | + isSkip: true, |
| 21 | + ruleType: RuleType.none, |
| 22 | + ruleValue: 0, |
| 23 | + theme: ChoiceQuestionTheme.common(), |
| 24 | + secondaryButtonText: 'SKIP', |
| 25 | + primaryButtonText: 'Next', |
| 26 | + ); |
| 27 | + |
| 28 | + static const choice2 = ChoiceQuestionData( |
| 29 | + isMultipleChoice: false, |
| 30 | + options: ['option 1', 'option 2'], |
| 31 | + index: 1, |
| 32 | + title: 'Another title', |
| 33 | + subtitle: 'Another subtitle', |
| 34 | + isSkip: false, |
| 35 | + content: 'content', |
| 36 | + ruleType: RuleType.none, |
| 37 | + ruleValue: 0, |
| 38 | + theme: ChoiceQuestionTheme( |
| 39 | + activeColor: SurveyColors.grey, |
| 40 | + inactiveColor: SurveyColors.grey, |
| 41 | + fill: SurveyColors.grey, |
| 42 | + titleColor: SurveyColors.grey, |
| 43 | + titleSize: _titleSize, |
| 44 | + subtitleColor: SurveyColors.grey, |
| 45 | + subtitleSize: _subtitleSize, |
| 46 | + primaryButtonFill: SurveyColors.grey, |
| 47 | + primaryButtonTextColor: SurveyColors.grey, |
| 48 | + primaryButtonTextSize: _buttonTextSize, |
| 49 | + primaryButtonRadius: _buttonRadius, |
| 50 | + secondaryButtonFill: SurveyColors.grey, |
| 51 | + secondaryButtonTextColor: SurveyColors.grey, |
| 52 | + secondaryButtonTextSize: _buttonTextSize, |
| 53 | + secondaryButtonRadius: _buttonRadius, |
| 54 | + ), |
| 55 | + secondaryButtonText: 'SKIP', |
| 56 | + primaryButtonText: 'Next', |
| 57 | + ); |
| 58 | + |
| 59 | + static final input1 = InputQuestionData( |
| 60 | + validator: InputValidator.text(), |
| 61 | + index: 0, |
| 62 | + title: 'title', |
| 63 | + subtitle: 'subtitle', |
| 64 | + isSkip: false, |
| 65 | + primaryButtonText: 'NEXT', |
| 66 | + theme: const InputQuestionTheme.common(), |
| 67 | + secondaryButtonText: 'SKIP', |
| 68 | + ); |
| 69 | + |
| 70 | + static final input2 = InputQuestionData( |
| 71 | + validator: InputValidator.number(), |
| 72 | + index: 1, |
| 73 | + title: 'Another title', |
| 74 | + subtitle: 'Another subtitle', |
| 75 | + isSkip: true, |
| 76 | + hintText: 'hint', |
| 77 | + primaryButtonText: 'NEXT', |
| 78 | + theme: const InputQuestionTheme( |
| 79 | + inputFill: Colors.blueAccent, |
| 80 | + borderColor: Colors.blueAccent, |
| 81 | + borderWidth: 1, |
| 82 | + lines: 1, |
| 83 | + hintColor: SurveyColors.textLightGrey, |
| 84 | + hintSize: SurveyFonts.sizeL, |
| 85 | + textColor: SurveyColors.black, |
| 86 | + textSize: SurveyFonts.sizeL, |
| 87 | + inputType: InputType.number, |
| 88 | + errorText: 'Error', |
| 89 | + isMultiline: false, |
| 90 | + fill: Colors.blueAccent, |
| 91 | + titleColor: Colors.blueAccent, |
| 92 | + titleSize: _titleSize, |
| 93 | + subtitleColor: Colors.blueAccent, |
| 94 | + subtitleSize: _subtitleSize, |
| 95 | + primaryButtonFill: Colors.blueAccent, |
| 96 | + primaryButtonTextColor: Colors.blueAccent, |
| 97 | + primaryButtonTextSize: _buttonTextSize, |
| 98 | + primaryButtonRadius: _buttonRadius, |
| 99 | + secondaryButtonFill: Colors.blueAccent, |
| 100 | + secondaryButtonTextColor: Colors.blueAccent, |
| 101 | + secondaryButtonTextSize: _buttonTextSize, |
| 102 | + secondaryButtonRadius: _buttonRadius, |
| 103 | + horizontalPadding: _horizontalPadding, |
| 104 | + verticalPadding: _verticalPadding, |
| 105 | + ), |
| 106 | + secondaryButtonText: 'SKIP', |
| 107 | + ); |
| 108 | + |
| 109 | + static const info1 = InfoQuestionData( |
| 110 | + primaryButtonText: 'Next', |
| 111 | + index: 0, |
| 112 | + title: 'title', |
| 113 | + subtitle: 'subtitle', |
| 114 | + isSkip: false, |
| 115 | + theme: InfoQuestionTheme.common(), |
| 116 | + secondaryButtonText: 'SKIP', |
| 117 | + ); |
| 118 | + |
| 119 | + static const info2 = InfoQuestionData( |
| 120 | + index: 1, |
| 121 | + title: 'Another title', |
| 122 | + subtitle: 'Another subtitle', |
| 123 | + isSkip: true, |
| 124 | + content: 'content', |
| 125 | + theme: InfoQuestionTheme( |
| 126 | + fill: SurveyColors.grey, |
| 127 | + titleColor: SurveyColors.grey, |
| 128 | + titleSize: SurveyFonts.sizeL, |
| 129 | + subtitleColor: SurveyColors.grey, |
| 130 | + subtitleSize: SurveyFonts.sizeS, |
| 131 | + primaryButtonFill: SurveyColors.grey, |
| 132 | + primaryButtonTextColor: SurveyColors.grey, |
| 133 | + primaryButtonTextSize: SurveyFonts.sizeS, |
| 134 | + primaryButtonRadius: SurveyDimensions.circularRadiusS, |
| 135 | + secondaryButtonFill: SurveyColors.grey, |
| 136 | + secondaryButtonTextColor: SurveyColors.grey, |
| 137 | + secondaryButtonTextSize: SurveyFonts.sizeS, |
| 138 | + secondaryButtonRadius: SurveyDimensions.circularRadiusS, |
| 139 | + ), |
| 140 | + secondaryButtonText: 'SKIP', |
| 141 | + primaryButtonText: 'Next', |
| 142 | + ); |
| 143 | + |
| 144 | + static const slider1 = SliderQuestionData( |
| 145 | + minValue: 0, |
| 146 | + maxValue: 10, |
| 147 | + initialValue: 1, |
| 148 | + index: 0, |
| 149 | + title: 'title', |
| 150 | + subtitle: 'subtitle', |
| 151 | + isSkip: false, |
| 152 | + divisions: 0, |
| 153 | + theme: SliderQuestionTheme.common(), |
| 154 | + secondaryButtonText: 'SKIP', |
| 155 | + primaryButtonText: 'Next', |
| 156 | + ); |
| 157 | + |
| 158 | + static const slider2 = SliderQuestionData( |
| 159 | + minValue: 10, |
| 160 | + maxValue: 100, |
| 161 | + initialValue: 50, |
| 162 | + index: 1, |
| 163 | + title: 'Another title', |
| 164 | + subtitle: 'Another subtitle', |
| 165 | + isSkip: true, |
| 166 | + divisions: 0, |
| 167 | + theme: SliderQuestionTheme( |
| 168 | + activeColor: Colors.grey, |
| 169 | + inactiveColor: Colors.grey, |
| 170 | + thumbColor: Colors.grey, |
| 171 | + thumbRadius: _thumbRadius, |
| 172 | + thickness: _thickness, |
| 173 | + fill: Colors.grey, |
| 174 | + titleColor: Colors.grey, |
| 175 | + titleSize: _titleSize, |
| 176 | + subtitleColor: Colors.grey, |
| 177 | + subtitleSize: _subtitleSize, |
| 178 | + primaryButtonFill: Colors.grey, |
| 179 | + primaryButtonTextColor: Colors.grey, |
| 180 | + primaryButtonTextSize: _buttonTextSize, |
| 181 | + primaryButtonRadius: _buttonRadius, |
| 182 | + secondaryButtonFill: Colors.grey, |
| 183 | + secondaryButtonTextColor: Colors.grey, |
| 184 | + secondaryButtonTextSize: _buttonTextSize, |
| 185 | + secondaryButtonRadius: _buttonRadius, |
| 186 | + ), |
| 187 | + secondaryButtonText: 'SKIP', |
| 188 | + primaryButtonText: 'Next', |
| 189 | + ); |
| 190 | + |
| 191 | + static final data1 = SurveyData( |
| 192 | + questions: [ |
| 193 | + info1.copyWith(index: 1), |
| 194 | + choice1.copyWith(index: 2), |
| 195 | + input1.copyWith(index: 3), |
| 196 | + slider1.copyWith(index: 4), |
| 197 | + ], |
| 198 | + commonTheme: _commonTheme, |
| 199 | + ); |
| 200 | + |
| 201 | + static final _commonTheme = CommonTheme( |
| 202 | + slider: const SliderQuestionData.common(), |
| 203 | + choice: const ChoiceQuestionData.common(), |
| 204 | + input: InputQuestionData.common(), |
| 205 | + info: const InfoQuestionData.common(), |
| 206 | + ); |
| 207 | +} |
0 commit comments