How can I solve createState function for ... returned an old or invalid state instance? How can I solve createState function for ... returned an old or invalid state instance? dart dart

How can I solve createState function for ... returned an old or invalid state instance?


I fixed my problem by editing my class to :

class SiteForm extends StatefulWidget {final ManageSiteModel site;final OnDelete onDelete;//adding new to this will remove the forms.var state= _SiteFormState();SiteForm({Key key, this.site, this.onDelete}) : super(key: key);@override_SiteFormState createState(){return this.state=new _SiteFormState();}bool isValid() => this.state.validate();}