gpt4 book ai didi

flutter - 断言失败 : line 24 pos 15: 'initialCameraPosition != null' : is not true

转载 作者:IT王子 更新时间:2023-10-29 07:12:36 25 4
gpt4 key购买 nike

我在 pubspec.yaml 中插入了下面的库

  google_maps_flutter:
git:
url: git://github.com/flutter/plugins
path: packages/google_maps_flutter

但是每次都报错

另一个异常被抛出:'file:///C:/src/flutter/.pub-cache/git/plugins-aedcc6f81843ae2da3a6ac0c8e8c4b530d1ac035/packages/google_maps_flutter/lib/src/google_map.dart':断言失败: line 24 pos 15: 'initialCameraPosition != null': is not true.

提前致谢。

最佳答案

只需在 GoogleMap() 中使用 initialCameraPosition例如:

GoogleMap(
onMapCreated: _onMapCreated,
initialCameraPosition: CameraPosition(target: LatLng(51.5160895, -0.1294527),),
)

关于flutter - 断言失败 : line 24 pos 15: 'initialCameraPosition != null' : is not true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54455771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com