I have been developing an application in web app builder. I am stuck at a point where I want to create a widget which would provide the demonstration of my complete application. I don't get it how to go about it. Please guide me.
GitHub is a great place to start for creating a custom widget. There are instructions and code samples for various widgets to get you started.
arcgis-webappbuilder-widgets-themes/widgets at master · Esri/arcgis-webappbuilder-widgets-themes · GitHub
Assuming you are using the Web AppBuilder developer addition, and not the AGOL version (where you can not add a custom widget), Check out the many resources and links on my blog Web AppBuilder Developer Edition - Resource List (updated 5/13/2018)
Retrieving data ...