resizeObserver property

ResizeObserver resizeObserver
latefinal

Implementation

late final resizeObserver = web.ResizeObserver(
  ((JSArray<web.ResizeObserverEntry> entries, web.ResizeObserver observer) {
    if (widget.height == null) {
      for (final entry in entries.toDart) {
        final cr = entry.contentRect;
        setState(() {
          height = cr.height.toDouble();
          _divElement.style.height = '${height}px';
        });
      }
    }
  }).toJS,
);