To convert a stateless widget to a stateful widget, simply clik on it, press alt + enter and select the convert option