Communicating between a plugin and a widget

I want to create a plugin and a widget with different functionalities, is it possible to collect the widget state by the plugin?

By “collect widget state” do you mean get widget state by plugin? No, it is immpossible. But you can set SharedPluginData to a WidgetNode and then get this data by the plugin.