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

[Discussions] 请问可以获取到光标位置吗 #218

Open
zedmyls opened this issue Jul 18, 2023 · 1 comment
Open

[Discussions] 请问可以获取到光标位置吗 #218

zedmyls opened this issue Jul 18, 2023 · 1 comment
Assignees

Comments

@zedmyls
Copy link

zedmyls commented Jul 18, 2023

Content

Snipaste_2023-07-18_15-46-52

在@时,弹出联系人选择弹窗,
需要在光标正上方弹出。

弹窗的弹出方式,我需要一个Offset:
FlyoutController().atController.showFlyout(
barrierColor: Colors.transparent,
placementMode: FlyoutPlacementMode.topLeft,
builder: (context) => Container(),
position: offset,
);

@imjakey
Copy link

imjakey commented Apr 3, 2024

同问,兄弟,我也是被这个问题困扰了很久,没有找到解决方案,唯一有用的信息是
https://stackoverflow.com/questions/59243627/flutter-how-to-get-the-coordinates-of-the-cursor-in-a-textfield
这里给到一中解决方案,但是对于multiline 的情况又不对,原提问者自己说用了一种奇技淫巧解决了问题,通过在 Positioned 里面插入一个Icon 组件来实时计算,我对这个还是不理解,Icon是如何跟随光标移动的。

希望 @zmtzawqlp 大佬能帮忙解答,是否有更完美的解决方案,非常感谢!!!

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

3 participants