I am trying to make it a widget button and switch the dashboard once it was clicked. Is there a way to achieve it?
You can use this script. It uses the standard BloX OpenURL action and will build and style a web page opening button. To try it create a new BloX widget and replace all the Editor pane script with this script. You can change the target parameter if you want to open in a different window, etc. _self opens in same window. This should allow you to navigate to another dashboard by clicking the button.
You can add additional action blocks to add more buttons with additional URL's if you want to build a navigation page with buttons.