失败的断言:24行POS 15: '!initialCameraPosition = NULL':是不是真的

问题描述 投票:0回答:1

我已经插入下面pubspec.yaml

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

但是,我得到一个错误每次

Another exception was thrown: 'file:///C:/src/flutter/.pub-cache/git/plugins-aedcc6f81843ae2da3a6ac0c8e8c4b530d1ac035/packages/google_maps_flutter/lib/src/google_map.dart': Failed assertion: line 24 pos 15: 'initialCameraPosition != null': is not true.

提前致谢。

flutter maps
1个回答
2
投票

只是使用缩写摄像机位置在谷歌地图()例如:

GoogleMap(
              onMapCreated: _onMapCreated,
              initialCameraPosition: CameraPosition(target: LatLng(51.5160895, -0.1294527),),
            )
© www.soinside.com 2019 - 2024. All rights reserved.