LateError(LateInitializationError:field' _state@590051772;尚未初始化。)
我不明白为什么我在_mapcontroller中遇到错误:
final MapController _mapController = MapController();
@override
void initState() {
super.initState();
_mapController.move(widget.latLng, _mapController.zoom);
}
I don't understand why I'm catching an error in _mapController:
final MapController _mapController = MapController();
@override
void initState() {
super.initState();
_mapController.move(widget.latLng, _mapController.zoom);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道,但是尝试吗? :
I don't know but try like this ? :
尝试以下代码
Try below code
我认为出现问题是因为您在构建函数启动之前开始使用MapController,这对地图具有必要的配置。尝试将此行放入
例如(_MoveMap)的方法中,然后在按下按钮时将其调用在构建功能中。
像这样:
I think the problem arises because you start using the mapcontroller before the build function starts which has the necessary configuration for the map. Try to put this line
inside a method for example (_moveMap) and call it inside the build function when pressing a button.
like this: