Here I have mentioned my code of checkbox. I am new to flutter, So I have to implement it for Remember me functionality.
Code:
Container(
padding: EdgeInsets.all(10.0),
child: Column(
children: <Widget>[
new Checkbox(value: checkBoxValue,
activeColor: Colors.green,
onChanged:(bool newValue){
setState(() {
checkBoxValue = newValue;
});
Text('Remember me');
}),
],
),
);
If you need a Checkbox with a label then you can use a CheckboxListTile
CheckboxListTile(
title: Text("title text"),
value: checkedValue,
onChanged: (newValue) {
setState(() {
checkedValue = newValue;
});
},
controlAffinity: ListTileControlAffinity.leading, // <-- leading Checkbox
)