【发布时间】:2021-06-29 11:17:35
【问题描述】:
我已经安装了Google Maps Place Picker
它返回正确的地图,我可以使用地理定位器获得正确的地址。
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => PlacePicker(
apiKey: APIKeys.apiKey, // Put YOUR OWN KEY here.
onPlacePicked: (result) {
print(result.address);
Navigator.of(context).pop();
},
initialPosition: HomePage.kInitialPosition,
useCurrentLocation: true,
),
),
);
现在这个result 返回 return.addressComponent,它应该是所选地址组件的列表。
我需要在 Map 中获取所有这些值,才能将这些数据推送到 Firestore。
有什么帮助吗?
【问题讨论】:
-
当您将结果推送到 Firestore 时,您可能需要注意使用 Places API 的应用程序受 Google Maps Platform Terms of Service 的约束,您不能在其中预取、索引、存储或缓存任何内容,但条款中规定的有限条件除外。
标签: flutter google-maps