Skip to content

Commit df9b90a

Browse files
committed
refactor(app_configuration): improve app review settings form layout
- Add padding around form elements - Improve spacing between sections - Update ExpansionTile layout for better readability - Adjust switch alignment for consistency - Update related localization strings to reflect new terminology
1 parent 9fc0361 commit df9b90a

File tree

7 files changed

+163
-142
lines changed

7 files changed

+163
-142
lines changed

lib/app_configuration/widgets/app_review_settings_form.dart

Lines changed: 137 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}

lib/app_configuration/widgets/community_config_form.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ class CommunityConfigForm extends StatelessWidget {
7878
),
7979
const SizedBox(height: AppSpacing.lg),
8080
ExpansionTile(
81-
title: Text(l10n.appFeedbackFunnelTitle),
81+
title: Text(l10n.appReviewFunnelTitle),
8282
subtitle: Text(
83-
l10n.appFeedbackFunnelDescription,
83+
l10n.appReviewFunnelDescription,
8484
style: subtitleStyle,
8585
),
8686
children: [

lib/l10n/app_localizations.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3155,7 +3155,7 @@ abstract class AppLocalizations {
31553155
/// Description for the Community & Engagement expansion tile.
31563156
///
31573157
/// In en, this message translates to:
3158-
/// **'Manage user interactions, content reporting, and the internal app feedback system.'**
3158+
/// **'Manage user interactions, content reporting, and the internal app reporting system.'**
31593159
String get communityAndEngagementDescription;
31603160

31613161
/// Title for the User Engagement expansion tile.
@@ -3182,17 +3182,17 @@ abstract class AppLocalizations {
31823182
/// **'Set rules for what users can report.'**
31833183
String get contentReportingDescription;
31843184

3185-
/// Title for the App Feedback Funnel expansion tile.
3185+
/// Title for the App Review Funnel expansion tile.
31863186
///
31873187
/// In en, this message translates to:
3188-
/// **'App Feedback Funnel'**
3189-
String get appFeedbackFunnelTitle;
3188+
/// **'App Reviews'**
3189+
String get appReviewFunnelTitle;
31903190

31913191
/// Description for the App Feedback Funnel expansion tile.
31923192
///
31933193
/// In en, this message translates to:
31943194
/// **'Manage the process for capturing user satisfaction and optionally requesting reviews.'**
3195-
String get appFeedbackFunnelDescription;
3195+
String get appReviewFunnelDescription;
31963196

31973197
/// Label for the master switch to enable all engagement features.
31983198
///

lib/l10n/app_localizations_ar.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,7 +1697,7 @@ class AppLocalizationsAr extends AppLocalizations {
16971697

16981698
@override
16991699
String get communityAndEngagementDescription =>
1700-
'إدارة تفاعلات المستخدمين، والإبلاغ عن المحتوى، ونظام ملاحظات التطبيق الداخلي.';
1700+
'إدارة تفاعلات المستخدمين، والإبلاغ عن المحتوى، ونظام مراجعات التطبيق الداخلي.';
17011701

17021702
@override
17031703
String get userEngagementTitle => 'مشاركة المستخدم';
@@ -1713,10 +1713,10 @@ class AppLocalizationsAr extends AppLocalizations {
17131713
'ضع قواعد لما يمكن للمستخدمين الإبلاغ عنه.';
17141714

17151715
@override
1716-
String get appFeedbackFunnelTitle => 'قمع ملاحظات التطبيق';
1716+
String get appReviewFunnelTitle => 'مراجعات التطبيق';
17171717

17181718
@override
1719-
String get appFeedbackFunnelDescription =>
1719+
String get appReviewFunnelDescription =>
17201720
'إدارة عملية جمع رضا المستخدم وطلب المراجعات اختياريًا.';
17211721

17221722
@override

lib/l10n/app_localizations_en.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,7 +1700,7 @@ class AppLocalizationsEn extends AppLocalizations {
17001700

17011701
@override
17021702
String get communityAndEngagementDescription =>
1703-
'Manage user interactions, content reporting, and the internal app feedback system.';
1703+
'Manage user interactions, content reporting, and the internal app reporting system.';
17041704

17051705
@override
17061706
String get userEngagementTitle => 'User Engagement';
@@ -1716,10 +1716,10 @@ class AppLocalizationsEn extends AppLocalizations {
17161716
'Set rules for what users can report.';
17171717

17181718
@override
1719-
String get appFeedbackFunnelTitle => 'App Feedback Funnel';
1719+
String get appReviewFunnelTitle => 'App Reviews';
17201720

17211721
@override
1722-
String get appFeedbackFunnelDescription =>
1722+
String get appReviewFunnelDescription =>
17231723
'Manage the process for capturing user satisfaction and optionally requesting reviews.';
17241724

17251725
@override

lib/l10n/arb/app_ar.arb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,7 @@
21222122
"@communityAndEngagementTitle": {
21232123
"description": "عنوان قسم المجتمع والمشاركة القابل للتوسيع."
21242124
},
2125-
"communityAndEngagementDescription": "إدارة تفاعلات المستخدمين، والإبلاغ عن المحتوى، ونظام ملاحظات التطبيق الداخلي.",
2125+
"communityAndEngagementDescription": "إدارة تفاعلات المستخدمين، والإبلاغ عن المحتوى، ونظام مراجعات التطبيق الداخلي.",
21262126
"@communityAndEngagementDescription": {
21272127
"description": "وصف قسم المجتمع والمشاركة القابل للتوسيع."
21282128
},
@@ -2142,13 +2142,13 @@
21422142
"@contentReportingDescription": {
21432143
"description": "وصف قسم الإبلاغ عن المحتوى القابل للتوسيع."
21442144
},
2145-
"appFeedbackFunnelTitle": "قمع ملاحظات التطبيق",
2146-
"@appFeedbackFunnelTitle": {
2147-
"description": "عنوان قسم قمع ملاحظات التطبيق القابل للتوسيع."
2145+
"appReviewFunnelTitle": "مراجعات التطبيق",
2146+
"@appReviewFunnelTitle": {
2147+
"description": "عنوان قسم مراجعات التطبيق القابل للتوسيع."
21482148
},
2149-
"appFeedbackFunnelDescription": "إدارة عملية جمع رضا المستخدم وطلب المراجعات اختياريًا.",
2150-
"@appFeedbackFunnelDescription": {
2151-
"description": "وصف قسم قمع ملاحظات التطبيق القابل للتوسيع."
2149+
"appReviewFunnelDescription": "إدارة عملية جمع رضا المستخدم وطلب المراجعات اختياريًا.",
2150+
"@appReviewFunnelDescription": {
2151+
"description": "وصف قسممراجعات التطبيق القابل للتوسيع."
21522152
},
21532153
"enableEngagementFeaturesLabel": "تفعيل ميزات المشاركة",
21542154
"@enableEngagementFeaturesLabel": {

0 commit comments

Comments
 (0)