setElementBackgroundBlur function
Sets element
background as a blur effect of size blurSize
.
Uses CSS property backdrop-filter
.
Implementation
void setElementBackgroundBlur(Element element, [int? blurSize]) {
blurSize ??= 3;
var filter = blurSize > 0 ? 'blur(${blurSize}px)' : 'none';
element.style.setProperty('backdrop-filter', filter);
}