backgroundImage property

  1. @override
CSSBackgroundImage? get backgroundImage
override

Background-image

Implementation

@override
CSSBackgroundImage? get backgroundImage => _backgroundImage;
set backgroundImage (CSSBackgroundImage? value)

Implementation

set backgroundImage(CSSBackgroundImage? value) {
  if (value == _backgroundImage) return;
  if (_backgroundImage != null) {
    _backgroundImage!.dispose();
  }

  _backgroundImage = value;
  if (DebugFlags.enableBackgroundLogs) {
    try {
      final el = target;
      final id = (el.id != null && el.id!.isNotEmpty) ? '#${el.id}' : '';
      final cls = (el.className.isNotEmpty) ? '.${el.className}' : '';
      final names = value?.functions.map((f) => f.name).toList() ?? const <String>[];
      renderingLogger.finer('[Background] set BACKGROUND_IMAGE on <${el.tagName.toLowerCase()}$id$cls> -> $names');
    } catch (_) {}
  }
  markNeedsPaint();
  resetBoxDecoration();
}