File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,9 @@ class MetaDataField {
9090/// must check the checkbox in order to sign up.
9191/// {@endtemplate}
9292class BooleanMetaDataField extends MetaDataField {
93+ /// Whether the checkbox is initially checked.
94+ final bool value;
95+
9396 /// Rich text spans for the label. If provided, this will be used instead of [label] .
9497 final List <InlineSpan >? richLabelSpans;
9598
@@ -110,6 +113,7 @@ class BooleanMetaDataField extends MetaDataField {
110113 /// {@macro boolean_metadata_field}
111114 BooleanMetaDataField ({
112115 String ? label,
116+ this .value = false ,
113117 this .richLabelSpans,
114118 this .checkboxSemanticLabel,
115119 this .isRequired = false ,
@@ -249,7 +253,9 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
249253 _metadataControllers = Map .fromEntries ((widget.metadataFields ?? []).map (
250254 (metadataField) => MapEntry (
251255 metadataField.key,
252- metadataField is BooleanMetaDataField ? false : TextEditingController (),
256+ metadataField is BooleanMetaDataField
257+ ? metadataField.value
258+ : TextEditingController (),
253259 ),
254260 ));
255261 }
You can’t perform that action at this time.
0 commit comments