Added the inState method to the widget class.