Add onChanged callback

fixes #2
This commit is contained in:
SimonIT 2021-11-14 20:03:25 +01:00
parent a8848b2ff3
commit 9e36a849ae
No known key found for this signature in database
GPG key ID: 8D07E7C11D5705EE
3 changed files with 35 additions and 6 deletions

View file

@ -52,14 +52,28 @@ Widget createScaffold() {
return 'False!';
}
},
onChanged: (value) {
if (value) {
print("ListTile Checked :)");
} else {
print("ListTile Not Checked :(");
}
},
),
CheckboxIconFormField(
initialValue: true,
enabled: false,
iconSize: 32,
onSaved: (bool? value) {},
onChanged: (value) {
if (value) {
print("Icon Checked :)");
} else {
print("Icon Not Checked :(");
}
},
),
RaisedButton(
ElevatedButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
_formKey.currentState!.save();