The method ‘setState’ isn’t defined for the class MyApp error in Flutter

I assume you are trying to setState in a stateless widget, which is immutable(unable to change).

Use a stateful widget to do so, like this:

class MainPage extends StatefulWidget{
  HomePage createState()=> HomePage();
}

class HomePage extends State<MainPage>{
 //Your code here
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)