setBound method

void setBound()

Implementation

void setBound() {
  try {
    if (boundKey.currentContext == null) return;
    if (boundRenderBox == null) boundRenderBox = boundKey.currentContext!.findRenderObject() as RenderBox?;

    if (boundRenderBox != null) {
      if (boundRenderBox!.hasSize) {
        if (boundWidth == -1) boundWidth = boundRenderBox!.size.width + widget.customBoundWidth;
        if (boundHeight == -1) boundHeight = boundRenderBox!.size.height + widget.customBoundHeight;

        if (boundWidth != -1 && boundHeight != -1) normaliseConstraints();
      }
    }
    if (boundOrigin == null) boundOrigin = boundRenderBox!.localToGlobal(Offset.zero);
  } catch (_) {}
}