在Google Map中单击按钮时出现抖动时重建标记

问题描述

我需要使用flutter从firestore中获取位置的数据,我具有位置列表和这些位置的标记,但是当我单击按钮时,列表会使用新位置再次重建,但是标记没有,我需要重新启动我的应用程序以便重建并显示标记?

               child: BlocBuilder<AddBloc,AddState>(
                  builder: (context,state) {
                    if (state is AddGetMarkerPositionState) {
                      return buildMap(state.marker);
                    } else if (state is AddErrorState) {
                      return Text(state.message);
                    } else if (state is AddCoordinatesCatchedState) {
                      return buildMap(state.marker);
                    } else if (state is AddErrorState) {
                      return Text(state.message);
                    } else {
                      return Container(
                        width: 0,height: 0,);
                    }
                  },),Search(),PlacesList()
            ],bottomNavigationBar: NavBarWidget(),);
  }

  Widget buildMap(Set<Marker> marker) {
    return GoogleMap(
      markers: marker,mapType: MapType.satellite,myLocationEnabled: true,initialCameraPosition: CameraPosition(
        target: _center,zoom: 13.0,onMapCreated: _onMapCreated,);
  }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)