refreshInlineConfigs method
Rebuilds already-mounted inline slot configs after a local design-theme
change. Trigger payloads are retained, so this does not replay CEP events
or impressions. Returning null removes a slot whose campaign no longer
parses under the selected theme.
Implementation
void refreshInlineConfigs(
CampaignConfigModel? Function(CEPTriggerPayload payload) resolve,
) {
if (_slotPayloads.isEmpty) return;
final removed = <CEPTriggerPayload>[];
for (final entry in _slotPayloads.entries.toList(growable: false)) {
final config = resolve(entry.value);
if (config == null) {
_slotPayloads.remove(entry.key);
_slotConfigs.remove(entry.key);
removed.add(entry.value);
} else {
_slotConfigs[entry.key] = config;
}
}
_notifyInlineRemoved(removed);
notifyListeners();
}