code: def selected_canvas_explayer(self):
          
          if self.lstCanvasExpLayers.selectedItems():
              item = self.lstCanvasExpLayers.currentItem()
          else:
              return None
          try:
              layer_id = item.data(Qt.UserRole)
          except (AttributeError, NameError):
              layer_id = None
  
          # noinspection PyArgumentList
          layer = QgsProject.instance().mapLayer(layer_id)
          return layer
docs: Obtain the canvas exposure layer selected by user.
  
          :returns: The currently selected map layer in the list.
          :rtype: QgsMapLayer