laravel
V2EX  ›  Flutter

问个 flutter 插件的问题

  •  
  •   laravel · Jul 16, 2019 · 8638 views
    This topic created in 2495 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   ·   5552 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 07:18 · PVG 15:18 · LAX 00:18 · JFK 03:18
    ♥ Do have faith in what you're doing.