V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
laravel
V2EX  ›  Flutter

问个 flutter 插件的问题

  •  
  •   laravel · Jul 16, 2019 · 8622 views
    This topic created in 2489 days ago, the information mentioned may be changed or developed.

    我写了个插件,调用百度定位获取地理位置,但是在 flutter 里 invokeMethod 调用原生的功能获取地理位置之后,原生的是个回调方法,我在回调方法里通过 Event Channel 把坐标传给 flutter 端,flutter 端通过这个 Event Channel 接收。

    我现在想把在 flutter 获取地理位置的操作变成同步的,我获取到位置之后,要判断距离,该怎么做?

    1 replies    2019-07-16 12:33:54 +08:00
    wsxyeah
        1
    wsxyeah  
       Jul 16, 2019 via iPhone
    答案是不能变成同步的,但你可以用 async/await。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1061 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 18:36 · PVG 02:36 · LAX 11:36 · JFK 14:36
    ♥ Do have faith in what you're doing.