Skip to content

Instantly share code, notes, and snippets.

@rapPayne
Last active October 21, 2020 22:33
Show Gist options
  • Save rapPayne/f9d688f4bd7b1383c2baff0a4029b92f to your computer and use it in GitHub Desktop.
Save rapPayne/f9d688f4bd7b1383c2baff0a4029b92f to your computer and use it in GitHub Desktop.
Validating a checkbox -- before
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