MarkerTapBehavior.togglePopupAndHideRest constructor

MarkerTapBehavior.togglePopupAndHideRest()

Toggle the popup of the tapped marker and hide all other popups. This is the recommended behavior if you only want to show one popup at a time.

Implementation

MarkerTapBehavior.togglePopupAndHideRest()
    : _onTap = ((
        PopupSpec popupSpec,
        PopupState popupState,
        PopupController popupController,
      ) {
        if (popupState.selectedPopupSpecs.contains(popupSpec)) {
          popupController.hideAllPopups();
        } else {
          popupController.showPopupsOnlyForSpecs([popupSpec]);
        }
      });