lpongetti/flutter_map_marker_cluster

PopUpOptions are set once and does not show on next build (when markers in map changes)

basnetjiten opened this issue · 0 comments

I have use popUpOptions like so:

popupOptions: PopupOptions(
popupAnimation: const PopupAnimation.fade(),
popupSnap: PopupSnap.markerBottom,
popupController:_popupController,
markerTapBehavior: MarkerTapBehavior.togglePopupAndHideRest(),
popupBuilder: (context, marker) {
try {
final adItem = widget.mapAdsItem.firstWhere((element) =>
LatLng(element.dropOffDetails!.coordinates![0],
element.dropOffDetails!.coordinates![1]) ==
marker.point);

          return Padding(
            padding: const EdgeInsets.only(top: 8.0),
            child: Card(
              elevation: 0,
              child: _cardDescription(context, adItem),
            ),
          );
        } catch (_) {
          return const SizedBox.shrink();
        }
      },
      popupState:PopupState(),
    ),

Please let me know if I have missed anything. It works for the first time and when the maps are rebuild they are not set with new values.