Last active
October 21, 2020 22:33
-
-
Save rapPayne/f9d688f4bd7b1383c2baff0a4029b92f to your computer and use it in GitHub Desktop.
Validating a checkbox -- before
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Widget get _buildAgreeToTermsField { | |
// TODO 8: Wrap the Column with a FormField<bool> | |
return Column( | |
children: <Widget>[ | |
Row( | |
children: <Widget>[ | |
Checkbox( | |
value: _agree, | |
onChanged: (bool val) => setState(() { | |
_agree = val; | |
}), | |
), | |
const Text("I agree to the terms."), | |
], | |
), | |
], | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment