Skip to content

Commit 9a0ff87

Browse files
committed
refactor(app_configuration): nest feed decorators section within an expansion tile
- Wrapped the entire feed decorators section in a new top-level ExpansionTile - Moved the description and individual decorator ExpansionTiles to be children of the new top-level tile - Updated padding and spacing for nested content - This change improves the layout and organization of the feed configuration interface
1 parent f92fec1 commit 9a0ff87

File tree

1 file changed

+50
-41
lines changed

1 file changed

+50
-41
lines changed

lib/app_configuration/view/tabs/feed_configuration_tab.dart

Lines changed: 50 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -48,51 +48,60 @@ class FeedConfigurationTab extends StatelessWidget {
4848
],
4949
),
5050
const SizedBox(height: AppSpacing.lg),
51-
// Description for Feed Decorators section
52-
Text(
53-
l10n.feedDecoratorsDescription,
54-
style: Theme.of(context).textTheme.bodySmall?.copyWith(
55-
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
51+
// New Top-level ExpansionTile for Feed Decorators
52+
ExpansionTile(
53+
title: Text(l10n.feedDecoratorsTitle),
54+
childrenPadding: const EdgeInsets.symmetric(
55+
horizontal: AppSpacing.xxl,
56+
vertical: AppSpacing.md,
5657
),
57-
),
58-
const SizedBox(height: AppSpacing.lg),
59-
// Individual ExpansionTiles for each Feed Decorator
60-
for (final decoratorType in FeedDecoratorType.values)
61-
Padding(
62-
padding: const EdgeInsets.only(bottom: AppSpacing.md),
63-
child: ExpansionTile(
64-
title: Text(decoratorType.l10n(context)), // Use localized decorator name
65-
childrenPadding: const EdgeInsets.symmetric(
66-
horizontal: AppSpacing.xxl,
58+
children: [
59+
Text(
60+
l10n.feedDecoratorsDescription,
61+
style: Theme.of(context).textTheme.bodySmall?.copyWith(
62+
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
6763
),
68-
children: [
69-
FeedDecoratorForm(
70-
decoratorType: decoratorType,
71-
remoteConfig: remoteConfig.copyWith(
72-
feedDecoratorConfig:
73-
Map.from(remoteConfig.feedDecoratorConfig)..putIfAbsent(
74-
decoratorType,
75-
() => FeedDecoratorConfig(
76-
category:
77-
decoratorType == FeedDecoratorType.suggestedTopics ||
78-
decoratorType == FeedDecoratorType.suggestedSources
79-
? FeedDecoratorCategory.contentCollection
80-
: FeedDecoratorCategory.callToAction,
81-
enabled: false,
82-
visibleTo: const {},
83-
itemsToDisplay:
84-
decoratorType == FeedDecoratorType.suggestedTopics ||
85-
decoratorType == FeedDecoratorType.suggestedSources
86-
? 0
87-
: null,
88-
),
89-
),
64+
),
65+
const SizedBox(height: AppSpacing.lg),
66+
// Individual ExpansionTiles for each Feed Decorator, nested
67+
for (final decoratorType in FeedDecoratorType.values)
68+
Padding(
69+
padding: const EdgeInsets.only(bottom: AppSpacing.md),
70+
child: ExpansionTile(
71+
title: Text(decoratorType.l10n(context)),
72+
childrenPadding: const EdgeInsets.symmetric(
73+
horizontal: AppSpacing.xxl,
9074
),
91-
onConfigChanged: onConfigChanged,
75+
children: [
76+
FeedDecoratorForm(
77+
decoratorType: decoratorType,
78+
remoteConfig: remoteConfig.copyWith(
79+
feedDecoratorConfig:
80+
Map.from(remoteConfig.feedDecoratorConfig)..putIfAbsent(
81+
decoratorType,
82+
() => FeedDecoratorConfig(
83+
category:
84+
decoratorType == FeedDecoratorType.suggestedTopics ||
85+
decoratorType == FeedDecoratorType.suggestedSources
86+
? FeedDecoratorCategory.contentCollection
87+
: FeedDecoratorCategory.callToAction,
88+
enabled: false,
89+
visibleTo: const {},
90+
itemsToDisplay:
91+
decoratorType == FeedDecoratorType.suggestedTopics ||
92+
decoratorType == FeedDecoratorType.suggestedSources
93+
? 0
94+
: null,
95+
),
96+
),
97+
),
98+
onConfigChanged: onConfigChanged,
99+
),
100+
],
92101
),
93-
],
94-
),
95-
),
102+
),
103+
],
104+
),
96105
],
97106
);
98107
}

0 commit comments

Comments
 (0)