I don't really understand what you're trying to achieve.
If it's just to display a layer as clusters, you don't need a widget or WAB, you just configure the layer to be shown as cluster layer through a webmap at Portal and consume that layer as you do through WAB.
If you would like to build a new custom widget that will display a layer/data as clusters that's quite an effort and you need to learn how to create custom widgets first and there are many guides to this that can help you, but it sounds like you just want to configure a layer with cluster symbology through a webmap on Portal.
Shay