Skip to content
New issue

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

ScreenUtil 最好能加个获取控制的位置 #15

Closed
lifetin opened this issue Jun 26, 2019 · 1 comment
Closed

ScreenUtil 最好能加个获取控制的位置 #15

lifetin opened this issue Jun 26, 2019 · 1 comment

Comments

@lifetin
Copy link

lifetin commented Jun 26, 2019

GlobalObjectKey conTextKey = GlobalObjectKey('contenxt');

RenderBox box = conTextKey.currentContext.findRenderObject();
box.localToGlobal(Offset.zero)

这样能获取某个控制在页面,的具体位置,一般页面滚动到某个位置后,要去回到某个控制的位置上去,就得这么干,
不同于直接滚动到0,这是要滚动到不确定的位置
参考
https://blog.csdn.net/developer_zhao/article/details/86305463

@Sky24n
Copy link
Owner

Sky24n commented Jun 27, 2019

这个很早就有了,在WidgetUtil里面。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants