clearQualityWarnings method
Clears lastQualityWarnings, called when a call ends so a stale value is not reported against the next call.
Implementation
@override
void clearQualityWarnings() {
final previous = _lastQualityWarnings?.current ?? const <CallQualityWarning>{};
_lastQualityWarnings = null;
if (previous.isEmpty) {
return;
}
// Publish the clear, else listeners of [qualityWarnings] keep reporting the last warnings of a
// call that has ended - nulling the field alone is invisible to the stream.
qualityWarningsController.add(CallQualityEvent(current: const {}, previous: previous));
}