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

flutter_floatwing 与 amap_map_fluttify 插件存在冲突 #6

Closed
cnyunguo opened this issue Jun 14, 2022 · 7 comments
Closed

flutter_floatwing 与 amap_map_fluttify 插件存在冲突 #6

cnyunguo opened this issue Jun 14, 2022 · 7 comments

Comments

@cnyunguo
Copy link

您好,我缩减了一个demo,可以提现这个问题,您有时间拉取一下看看。

Git:https://github.com/cnyunguo/amap_demo

@jiusanzhou
Copy link
Owner

jiusanzhou commented Jun 15, 2022

请描述一下具体是什么问题,并贴上相应的日志信息。

@cnyunguo
Copy link
Author

您好,我重现了demo,创建悬浮窗之后会影响到amap_map_fluttify的回调。

@cnyunguo
Copy link
Author

重现办法:

  • 打开悬浮窗,获取位置:NO
  • 获取位置,打开悬浮窗,再次获取位置:OK

@cnyunguo
Copy link
Author

Flutter (Channel stable, 2.10.5-0.0.pre.1, on Microsoft Windows [Version 10.0.18363.1556], locale zh-CN)
Kotlin Version = '1.6.10'

@jiusanzhou
Copy link
Owner

我尝试了一下,你这个demo依然在我的环境中无法编译成功,是你依赖的那个库的问题。我暂时没时间降flutter版本,因为我并非客户端开发。

我这里给个猜测你可以去验证一下:

  • amap_map_fluttify 这个插件是静态注册channel的,你启动window时,因为也代码是同一份也导入这个库,会再次注册method channel,导致main engine中的channel handler失效

你可以通过下面的一些方法验证,

  • 在window中调用你需要的方法,看看是否正常
  • window中代码独立出来,看看是否正常

@cnyunguo
Copy link
Author

我尝试了一下,你这个demo依然在我的环境中无法编译成功,是你依赖的那个库的问题。我暂时没时间降flutter版本,因为我并非客户端开发。

我这里给个猜测你可以去验证一下:

  • amap_map_fluttify 这个插件是静态注册channel的,你启动window时,因为也代码是同一份也导入这个库,会再次注册method channel,导致main engine中的channel handler失效

你可以通过下面的一些方法验证,

  • 在window中调用你需要的方法,看看是否正常
  • window中代码独立出来,看看是否正常

谢谢,float window里面是正常的,主程序里面的channel handler缺失是被float window中重置替代了,您刚才所说静态注册channel,您的思路是对的。

我在考虑怎么避免float window的时候重置,在float window里面我可以使用其他的定位方法。

@jiusanzhou
Copy link
Owner

Hi, 这个问题我会在一个新的issue中来跟踪,所以会关闭这个问题。

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