We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
有时需要根据Widget的坐标进行相应处理,可以通过GlobalKey的currentContext.findRenderObject()获取该组件的RenderBox,从而得到相关数据。
GlobalKey
currentContext.findRenderObject()
The text was updated successfully, but these errors were encountered:
RenderBox renderBox = youKey.currentContext.findRenderObject(); var offsetGlobal = renderBox.localToGlobal(Offset.zero); Rect globalRect = Rect.fromPoints( offsetGlobal, offsetGlobal.translate( renderBox.size.width, renderBox.size.height));
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: