@@ -78,135 +78,156 @@ class _AppReviewSettingsFormState extends State<AppReviewSettingsForm> {
7878 final appReviewConfig = communityConfig.appReview;
7979
8080 return Column (
81- crossAxisAlignment: CrossAxisAlignment .start,
8281 children: [
83- SwitchListTile (
84- title: Text (l10n.enableAppFeedbackSystemLabel),
85- subtitle: Text (l10n.enableAppFeedbackSystemDescription),
86- value: appReviewConfig.enabled,
87- onChanged: (value) {
88- final newConfig = communityConfig.copyWith (
89- appReview: appReviewConfig.copyWith (enabled: value),
90- );
91- widget.onConfigChanged (
92- widget.remoteConfig.copyWith (
93- features: widget.remoteConfig.features.copyWith (
94- community: newConfig,
95- ),
82+ Padding (
83+ padding: const EdgeInsets .symmetric (horizontal: AppSpacing .lg),
84+ child: Column (
85+ crossAxisAlignment: CrossAxisAlignment .start,
86+ children: [
87+ SwitchListTile (
88+ title: Text (l10n.enableAppFeedbackSystemLabel),
89+ subtitle: Text (l10n.enableAppFeedbackSystemDescription),
90+ value: appReviewConfig.enabled,
91+ onChanged: (value) {
92+ final newConfig = communityConfig.copyWith (
93+ appReview: appReviewConfig.copyWith (enabled: value),
94+ );
95+ widget.onConfigChanged (
96+ widget.remoteConfig.copyWith (
97+ features: widget.remoteConfig.features.copyWith (
98+ community: newConfig,
99+ ),
100+ ),
101+ );
102+ },
96103 ),
97- );
98- },
99- ),
100- const SizedBox (height: AppSpacing .lg),
101- if (appReviewConfig.enabled)
102- Padding (
103- padding: const EdgeInsetsDirectional .only (start: AppSpacing .lg),
104- child: Column (
105- children: [
106- ExpansionTile (
107- title: Text (l10n.internalPromptLogicTitle),
108- childrenPadding: const EdgeInsetsDirectional .only (
104+ if (appReviewConfig.enabled) ...[
105+ const SizedBox (height: AppSpacing .lg),
106+ Padding (
107+ padding: const EdgeInsetsDirectional .only (
109108 start: AppSpacing .lg,
110- top: AppSpacing .md,
111- bottom: AppSpacing .md,
112109 ),
113- expandedCrossAxisAlignment: CrossAxisAlignment .start,
114- children: [
115- AppConfigIntField (
116- label: l10n.positiveInteractionThresholdLabel,
117- description: l10n.positiveInteractionThresholdDescription,
118- value: appReviewConfig.positiveInteractionThreshold,
119- onChanged: (value) {
120- final newConfig = communityConfig.copyWith (
121- appReview: appReviewConfig.copyWith (
122- positiveInteractionThreshold: value,
110+ child: Column (
111+ children: [
112+ ExpansionTile (
113+ title: Text (l10n.internalPromptLogicTitle),
114+ childrenPadding: const EdgeInsetsDirectional .only (
115+ start: AppSpacing .lg,
116+ top: AppSpacing .md,
117+ bottom: AppSpacing .md,
118+ ),
119+ expandedCrossAxisAlignment: CrossAxisAlignment .start,
120+ children: [
121+ AppConfigIntField (
122+ label: l10n.positiveInteractionThresholdLabel,
123+ description:
124+ l10n.positiveInteractionThresholdDescription,
125+ value: appReviewConfig.positiveInteractionThreshold,
126+ onChanged: (value) {
127+ final newConfig = communityConfig.copyWith (
128+ appReview: appReviewConfig.copyWith (
129+ positiveInteractionThreshold: value,
130+ ),
131+ );
132+ widget.onConfigChanged (
133+ widget.remoteConfig.copyWith (
134+ features: widget.remoteConfig.features
135+ .copyWith (
136+ community: newConfig,
137+ ),
138+ ),
139+ );
140+ },
141+ controller: _positiveInteractionThresholdController,
123142 ),
124- );
125- widget.onConfigChanged (
126- widget.remoteConfig.copyWith (
127- features: widget.remoteConfig.features.copyWith (
128- community: newConfig,
129- ),
143+ AppConfigIntField (
144+ label: l10n.initialPromptCooldownLabel,
145+ description: l10n.initialPromptCooldownDescription,
146+ value: appReviewConfig.initialPromptCooldownDays,
147+ onChanged: (value) {
148+ final newConfig = communityConfig.copyWith (
149+ appReview: appReviewConfig.copyWith (
150+ initialPromptCooldownDays: value,
151+ ),
152+ );
153+ widget.onConfigChanged (
154+ widget.remoteConfig.copyWith (
155+ features: widget.remoteConfig.features
156+ .copyWith (
157+ community: newConfig,
158+ ),
159+ ),
160+ );
161+ },
162+ controller: _initialPromptCooldownController,
130163 ),
131- );
132- },
133- controller: _positiveInteractionThresholdController,
134- ),
135- AppConfigIntField (
136- label: l10n.initialPromptCooldownLabel,
137- description: l10n.initialPromptCooldownDescription,
138- value: appReviewConfig.initialPromptCooldownDays,
139- onChanged: (value) {
140- final newConfig = communityConfig.copyWith (
141- appReview: appReviewConfig.copyWith (
142- initialPromptCooldownDays: value,
164+ ],
165+ ),
166+ const SizedBox (height: AppSpacing .lg),
167+ ExpansionTile (
168+ title: Text (l10n.followUpActionsTitle),
169+ childrenPadding: const EdgeInsetsDirectional .only (
170+ start: AppSpacing .lg,
171+ top: AppSpacing .md,
172+ bottom: AppSpacing .md,
173+ ),
174+ expandedCrossAxisAlignment: CrossAxisAlignment .start,
175+ children: [
176+ SwitchListTile (
177+ title: Text (l10n.requestStoreReviewLabel),
178+ subtitle: Text (l10n.requestStoreReviewDescription),
179+ value: appReviewConfig
180+ .isPositiveFeedbackFollowUpEnabled,
181+ onChanged: (value) {
182+ final newAppReviewConfig = appReviewConfig
183+ .copyWith (
184+ isPositiveFeedbackFollowUpEnabled: value,
185+ );
186+ widget.onConfigChanged (
187+ widget.remoteConfig.copyWith (
188+ features: widget.remoteConfig.features
189+ .copyWith (
190+ community: communityConfig.copyWith (
191+ appReview: newAppReviewConfig,
192+ ),
193+ ),
194+ ),
195+ );
196+ },
143197 ),
144- );
145- widget.onConfigChanged (
146- widget.remoteConfig.copyWith (
147- features: widget.remoteConfig.features.copyWith (
148- community: newConfig,
198+ SwitchListTile (
199+ title: Text (l10n.requestWrittenFeedbackLabel),
200+ subtitle: Text (
201+ l10n.requestWrittenFeedbackDescription,
149202 ),
203+ value: appReviewConfig
204+ .isNegativeFeedbackFollowUpEnabled,
205+ onChanged: (value) {
206+ final newAppReviewConfig = appReviewConfig
207+ .copyWith (
208+ isNegativeFeedbackFollowUpEnabled: value,
209+ );
210+ widget.onConfigChanged (
211+ widget.remoteConfig.copyWith (
212+ features: widget.remoteConfig.features
213+ .copyWith (
214+ community: communityConfig.copyWith (
215+ appReview: newAppReviewConfig,
216+ ),
217+ ),
218+ ),
219+ );
220+ },
150221 ),
151- );
152- },
153- controller: _initialPromptCooldownController,
154- ),
155- ],
156- ),
157- const SizedBox (height: AppSpacing .lg),
158- ExpansionTile (
159- title: Text (l10n.followUpActionsTitle),
160- childrenPadding: const EdgeInsetsDirectional .only (
161- start: AppSpacing .lg,
162- top: AppSpacing .md,
163- bottom: AppSpacing .md,
222+ ],
223+ ),
224+ ],
164225 ),
165- expandedCrossAxisAlignment: CrossAxisAlignment .start,
166- children: [
167- SwitchListTile (
168- title: Text (l10n.requestStoreReviewLabel),
169- subtitle: Text (l10n.requestStoreReviewDescription),
170- value: appReviewConfig.isPositiveFeedbackFollowUpEnabled,
171- onChanged: (value) {
172- final newAppReviewConfig = appReviewConfig.copyWith (
173- isPositiveFeedbackFollowUpEnabled: value,
174- );
175- widget.onConfigChanged (
176- widget.remoteConfig.copyWith (
177- features: widget.remoteConfig.features.copyWith (
178- community: communityConfig.copyWith (
179- appReview: newAppReviewConfig,
180- ),
181- ),
182- ),
183- );
184- },
185- ),
186- SwitchListTile (
187- title: Text (l10n.requestWrittenFeedbackLabel),
188- subtitle: Text (l10n.requestWrittenFeedbackDescription),
189- value: appReviewConfig.isNegativeFeedbackFollowUpEnabled,
190- onChanged: (value) {
191- final newAppReviewConfig = appReviewConfig.copyWith (
192- isNegativeFeedbackFollowUpEnabled: value,
193- );
194- widget.onConfigChanged (
195- widget.remoteConfig.copyWith (
196- features: widget.remoteConfig.features.copyWith (
197- community: communityConfig.copyWith (
198- appReview: newAppReviewConfig,
199- ),
200- ),
201- ),
202- );
203- },
204- ),
205- ],
206226 ),
207227 ],
208- ) ,
228+ ] ,
209229 ),
230+ ),
210231 ],
211232 );
212233 }
0 commit comments