Open himanshu-neutrorion opened 4 years ago
Same here, the SetState doesn't work for me ... i don't know why
Expanded( child: Padding( padding: EdgeInsets.all(15.0), child: FlatButton( textColor: Colors.white, color: Colors.green, child: Text( 'True', style: TextStyle( color: Colors.white, fontSize: 20.0, ), ), onPressed: () { //The user picked true. setState(() { scoreKeeper.add( new Icon( Icons.check, color: Colors.green, ), ); }); }, ), ), ),
The below code also works very well. See the last line where setState does not have anything inside it, but everything is outside it. Still everything works.