簡體   English   中英

如何使用 Flutter 在 Google MapView 上檢測 animateCamera 是否完成?

[英]How to detect animateCamera did finish on the Google MapView using Flutter?

我想在動畫相機完成時執行 API 請求。

獲得信號的方法是什么,動畫相機確實完成了動畫?

下面是我如何使用 animateCamera 的代碼。

GoogleMapController mapController;

// … setting up MapView and GoogleMapController 

CameraPosition cameraPosition = CameraPosition(target: position, zoom: 12.0);
mapController.animateCamera(CameraUpdate.newCameraPosition(cameraPosition));

當相機移動完成時調用 onCameraIdle ,

 GoogleMap( onCameraIdle: _onCameraMoveEnd,....)

_onCameraMoveEnd() {
    setState(() {
    //todo
    });
  }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM