Des*_*nga 3 flutter google-cloud-firestore
FirebaseFirestore.instance.collection('locations').getDocuments().then((docs){
if(docs.documents.isNotEmpty){
for(int i=0 ;i<docs.documents.length;i++){
initMarker(docs.documents[i].data , docs.documents[i].documentID);
}
}
});
}
Run Code Online (Sandbox Code Playgroud)
初始化标记捕捉
void initMarker(request,requestId){
var markerIdVal = requestId;
final MarkerId markerId = MarkerId(markerIdVal);
//creating a new Marker
final Marker marker = Marker(
markerId:markerId,
position:LatLng(request['loc_Coords'].lattitude,request['loc_Coords'].longitude),
infoWindow:InfoWindow(
title:request['loc_Name'],
snippet:request['loc_Description'],
),
);
setState((){
markers[markerId] = marker;
print(markerId);
});
Run Code Online (Sandbox Code Playgroud)
没有为类型“CollectionReference”定义方法“getDocuments”。
请你帮我消除这个错误吗?
| 归档时间: |
|
| 查看次数: |
4564 次 |
| 最近记录: |