getTop method

double getTop()

Get the top position of the widget

Implementation

double getTop() {
  final box = key!.currentContext!.findRenderObject() as RenderBox;
  final boxOffset = box.localToGlobal(const Offset(0.0, 0.0));
  if (boxOffset.dy.isNaN) return 0 - padding.top;
  final topLeft = box.size.topLeft(boxOffset);
  return topLeft.dy - padding.top;
}