clearInlineSlot method

void clearInlineSlot(
  1. String slotKey, {
  2. DismissReason? reason = DismissReason.userClose,
})

Clears the inline slot at slotKey, if any. No-op if nothing is active there. reason is how the removal is reported; the default is the user's, and null reports nothing.

Implementation

void clearInlineSlot(String slotKey,
    {DismissReason? reason = DismissReason.userClose}) {
  final removedConfig = _slotConfigs.remove(slotKey);
  final removedPayload = _slotPayloads.remove(slotKey);
  if (removedConfig == null && removedPayload == null) return;
  if (removedPayload != null) {
    _notifyInlineRemoved([removedPayload], reason);
  }
  notifyListeners();
}