code: def display_information_message_bar(
          title=None,
          message=None,
          more_details=None,
          button_text=tr('Show details ...'),
          duration=8,
          iface_object=iface):
      
      iface_object.messageBar().clearWidgets()
      widget = iface_object.messageBar().createMessage(title, message)
  
      if more_details:
          button = QPushButton(widget)
          button.setText(button_text)
          button.pressed.connect(
              lambda: display_information_message_box(
                  title=title, message=more_details))
          widget.layout().addWidget(button)
  
      iface_object.messageBar().pushWidget(widget, Qgis.Info, duration)
docs: Display an information message bar.
  
      :param iface_object: The QGIS IFace instance. Note that we cannot
          use qgis.utils.iface since it is not available in our
          test environment.
      :type iface_object: QgisInterface
  
      :param title: The title of the message bar.
      :type title: basestring
  
      :param message: The message inside the message bar.
      :type message: basestring
  
      :param more_details: The message inside the 'Show details' button.
      :type more_details: basestring
  
      :param button_text: The text of the button if 'more_details' is not empty.
      :type button_text: basestring
  
      :param duration: The duration for the display, default is 8 seconds.
      :type duration: int