registerPresentationSize method

Function registerPresentationSize(
  1. dynamic fn(
    1. double width,
    2. double height
    )
)

Implementation

Function registerPresentationSize(Function(double width, double height) fn) {
  if (_width != 0 && _height != 0) {
    fn(_width, _height);
  }

  handle(List value) {
    var size = value.cast<double>();

    _width = size.first;
    _height = size.last;

    if (_width != 0 && _height != 0) {
      fn(_width, _height);
    }
  }

  on("onPresentationSize", handle);
  return () => off("onPresentationSize", handle);
}