Skip to content

Commit 2e8c039

Browse files
committed
feat(app_configuration): add expansion tiles for app review settings
- Add ExpansionTile for internal prompt logic settings - Add ExpansionTile for follow-up actions settings - Move positive interaction threshold and initial prompt cooldown fields inside the new tiles - Add switches for requesting store review and written feedback in the follow-up actions tile
1 parent ea6bef4 commit 2e8c039

File tree

1 file changed

+99
-38
lines changed

1 file changed

+99
-38
lines changed

lib/app_configuration/widgets/app_review_settings_form.dart

Lines changed: 99 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -98,45 +98,106 @@ class _AppReviewSettingsFormState extends State<AppReviewSettingsForm> {
9898
},
9999
),
100100
const SizedBox(height: AppSpacing.lg),
101-
AppConfigIntField(
102-
label: l10n.positiveInteractionThresholdLabel,
103-
description: l10n.positiveInteractionThresholdDescription,
104-
value: appReviewConfig.positiveInteractionThreshold,
105-
onChanged: (value) {
106-
final newConfig = communityConfig.copyWith(
107-
appReview: appReviewConfig.copyWith(
108-
positiveInteractionThreshold: value,
109-
),
110-
);
111-
widget.onConfigChanged(
112-
widget.remoteConfig.copyWith(
113-
features: widget.remoteConfig.features.copyWith(
114-
community: newConfig,
115-
),
116-
),
117-
);
118-
},
119-
controller: _positiveInteractionThresholdController,
101+
ExpansionTile(
102+
title: Text(l10n.internalPromptLogicTitle),
103+
childrenPadding: const EdgeInsetsDirectional.only(
104+
start: AppSpacing.lg,
105+
top: AppSpacing.md,
106+
bottom: AppSpacing.md,
107+
),
108+
expandedCrossAxisAlignment: CrossAxisAlignment.start,
109+
children: [
110+
AppConfigIntField(
111+
label: l10n.positiveInteractionThresholdLabel,
112+
description: l10n.positiveInteractionThresholdDescription,
113+
value: appReviewConfig.positiveInteractionThreshold,
114+
onChanged: (value) {
115+
final newConfig = communityConfig.copyWith(
116+
appReview: appReviewConfig.copyWith(
117+
positiveInteractionThreshold: value,
118+
),
119+
);
120+
widget.onConfigChanged(
121+
widget.remoteConfig.copyWith(
122+
features: widget.remoteConfig.features.copyWith(
123+
community: newConfig,
124+
),
125+
),
126+
);
127+
},
128+
controller: _positiveInteractionThresholdController,
129+
),
130+
AppConfigIntField(
131+
label: l10n.initialPromptCooldownLabel,
132+
description: l10n.initialPromptCooldownDescription,
133+
value: appReviewConfig.initialPromptCooldownDays,
134+
onChanged: (value) {
135+
final newConfig = communityConfig.copyWith(
136+
appReview: appReviewConfig.copyWith(
137+
initialPromptCooldownDays: value,
138+
),
139+
);
140+
widget.onConfigChanged(
141+
widget.remoteConfig.copyWith(
142+
features: widget.remoteConfig.features.copyWith(
143+
community: newConfig,
144+
),
145+
),
146+
);
147+
},
148+
controller: _initialPromptCooldownController,
149+
),
150+
],
120151
),
121-
AppConfigIntField(
122-
label: l10n.initialPromptCooldownLabel,
123-
description: l10n.initialPromptCooldownDescription,
124-
value: appReviewConfig.initialPromptCooldownDays,
125-
onChanged: (value) {
126-
final newConfig = communityConfig.copyWith(
127-
appReview: appReviewConfig.copyWith(
128-
initialPromptCooldownDays: value,
129-
),
130-
);
131-
widget.onConfigChanged(
132-
widget.remoteConfig.copyWith(
133-
features: widget.remoteConfig.features.copyWith(
134-
community: newConfig,
135-
),
136-
),
137-
);
138-
},
139-
controller: _initialPromptCooldownController,
152+
const SizedBox(height: AppSpacing.lg),
153+
ExpansionTile(
154+
title: Text(l10n.followUpActionsTitle),
155+
childrenPadding: const EdgeInsetsDirectional.only(
156+
start: AppSpacing.lg,
157+
top: AppSpacing.md,
158+
bottom: AppSpacing.md,
159+
),
160+
expandedCrossAxisAlignment: CrossAxisAlignment.start,
161+
children: [
162+
SwitchListTile(
163+
title: Text(l10n.requestStoreReviewLabel),
164+
subtitle: Text(l10n.requestStoreReviewDescription),
165+
value: appReviewConfig.isPositiveFeedbackFollowUpEnabled,
166+
onChanged: (value) {
167+
final newAppReviewConfig = appReviewConfig.copyWith(
168+
isPositiveFeedbackFollowUpEnabled: value,
169+
);
170+
widget.onConfigChanged(
171+
widget.remoteConfig.copyWith(
172+
features: widget.remoteConfig.features.copyWith(
173+
community: communityConfig.copyWith(
174+
appReview: newAppReviewConfig,
175+
),
176+
),
177+
),
178+
);
179+
},
180+
),
181+
SwitchListTile(
182+
title: Text(l10n.requestWrittenFeedbackLabel),
183+
subtitle: Text(l10n.requestWrittenFeedbackDescription),
184+
value: appReviewConfig.isNegativeFeedbackFollowUpEnabled,
185+
onChanged: (value) {
186+
final newAppReviewConfig = appReviewConfig.copyWith(
187+
isNegativeFeedbackFollowUpEnabled: value,
188+
);
189+
widget.onConfigChanged(
190+
widget.remoteConfig.copyWith(
191+
features: widget.remoteConfig.features.copyWith(
192+
community: communityConfig.copyWith(
193+
appReview: newAppReviewConfig,
194+
),
195+
),
196+
),
197+
);
198+
},
199+
),
200+
],
140201
),
141202
],
142203
);

0 commit comments

Comments
 (0)