setWidgetState function

Update Widget State