initstate in flutter code example
Example 1: initstate flutter
@override
void initState() {
super.initState();
///whatever you want to run on page build
}
Example 2: setstate flutter
setState(() { _myState = newValue; });
@override
void initState() {
super.initState();
///whatever you want to run on page build
}
setState(() { _myState = newValue; });