location property

Offset? get location

获得控件正下方的坐标:

Implementation

Offset? get location {
  final RenderBox? renderBox = currentContext?.findRenderObject() as RenderBox?;
  // final Offset? offset = renderBox?.localToGlobal(Offset.zero);
  final Offset? offset = renderBox?.localToGlobal(Offset(0.0, renderBox.size.height));
  return offset;
}