Flutter checkbox doesn’t work. Use the below working example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | class _MyHomePageState extends State<MyHomePage> { bool flagWarranty=false; @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar(title: Text(widget.title)), body: new Container( padding: new EdgeInsets.all(20.0), child: new Form( key: this._formKey, child: new ListView( children: <Widget>[ new Checkbox( value: flagWarranty, onChanged: (bool value) { setState(( ) { flagWarranty=value; }); }, ) ],),))); }} |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.