I have some widget in custom theme and that theme should be imported automatically. -> after click on import button all the required widget, blocks and pages will be installed in back end. I had already done with block and pages but I need to do it for widget now. Its really appreciated, If anyone can help me. Thanks.
this link help to create and get some idea about create widget and how it work. https://www.mageplaza.com/devdocs/magento-2-create-widget/