Try correcting the name to the name of an existing method, or defining a method named 'setState'. setState(() { code example
Example: setstate flutter
setState(() { _myState = newValue; });
setState(() { _myState = newValue; });