Skip to content

Commit a727811

Browse files
committed
fix(app_configuration): disable ad platform tiles correctly when ads are off
- Add 'enabled' property to ExpansionTile to completely disable tiles when ads are off - This change ensures that ad platform tiles are not just non-expandable, but also disabled - The fix is applied to all ad platform tiles: AdPlatformConfig, FeedAdSettings, ArticleAdSettings, and InterstitialAdSettings
1 parent 9f9be2d commit a727811

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/app_configuration/view/tabs/advertisements_configuration_tab.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ class _AdvertisementsConfigurationTabState
7777
? (isExpanded) {
7878
_expandedTileIndex.value = isExpanded ? tileIndex : null;
7979
}
80-
: null, // Disable expansion if global ads are off
80+
: null,
8181
initiallyExpanded: expandedIndex == tileIndex && adConfig.enabled,
82+
enabled: adConfig.enabled, // Disable the tile itself
8283
children: [
8384
AdPlatformConfigForm(
8485
remoteConfig: widget.remoteConfig,
@@ -107,8 +108,9 @@ class _AdvertisementsConfigurationTabState
107108
? (isExpanded) {
108109
_expandedTileIndex.value = isExpanded ? tileIndex : null;
109110
}
110-
: null, // Disable expansion if global ads are off
111+
: null,
111112
initiallyExpanded: expandedIndex == tileIndex && adConfig.enabled,
113+
enabled: adConfig.enabled, // Disable the tile itself
112114
children: [
113115
FeedAdSettingsForm(
114116
remoteConfig: widget.remoteConfig,
@@ -137,8 +139,9 @@ class _AdvertisementsConfigurationTabState
137139
? (isExpanded) {
138140
_expandedTileIndex.value = isExpanded ? tileIndex : null;
139141
}
140-
: null, // Disable expansion if global ads are off
142+
: null,
141143
initiallyExpanded: expandedIndex == tileIndex && adConfig.enabled,
144+
enabled: adConfig.enabled, // Disable the tile itself
142145
children: [
143146
ArticleAdSettingsForm(
144147
remoteConfig: widget.remoteConfig,
@@ -167,8 +170,9 @@ class _AdvertisementsConfigurationTabState
167170
? (isExpanded) {
168171
_expandedTileIndex.value = isExpanded ? tileIndex : null;
169172
}
170-
: null, // Disable expansion if global ads are off
173+
: null,
171174
initiallyExpanded: expandedIndex == tileIndex && adConfig.enabled,
175+
enabled: adConfig.enabled, // Disable the tile itself
172176
children: [
173177
InterstitialAdSettingsForm(
174178
remoteConfig: widget.remoteConfig,

0 commit comments

Comments
 (0)