Skip to content

Commit 538f7c4

Browse files
authored
Add autoFormValidation to MetaDataField (#125)
Remove hardcoded styling for BooleanMetaDataField to prevent it from overriding an app's ThemeData
1 parent 28e064e commit 538f7c4

File tree

1 file changed

+2
-20
lines changed

1 file changed

+2
-20
lines changed

lib/src/components/supa_email_auth.dart

+2-20
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,6 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
364364
: null,
365365
builder: (FormFieldState<bool> field) {
366366
final theme = Theme.of(context);
367-
final isDark =
368-
theme.brightness == Brightness.dark;
369367

370368
return Column(
371369
crossAxisAlignment: CrossAxisAlignment.start,
@@ -389,24 +387,6 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
389387
contentPadding:
390388
const EdgeInsets.symmetric(
391389
horizontal: 4.0),
392-
activeColor: theme.colorScheme.primary,
393-
checkColor: theme.colorScheme.onPrimary,
394-
tileColor: isDark
395-
? theme.inputDecorationTheme.fillColor
396-
: null,
397-
shape: RoundedRectangleBorder(
398-
borderRadius: BorderRadius.circular(4),
399-
side: BorderSide(
400-
color: field.hasError
401-
? theme.colorScheme.error
402-
: theme
403-
.inputDecorationTheme
404-
.border
405-
?.borderSide
406-
.color ??
407-
theme.dividerColor,
408-
),
409-
),
410390
),
411391
if (field.hasError)
412392
Padding(
@@ -440,6 +420,8 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> {
440420
prefixIcon: metadataField.prefixIcon,
441421
),
442422
validator: metadataField.validator,
423+
autovalidateMode:
424+
AutovalidateMode.onUserInteraction,
443425
onFieldSubmitted: (_) {
444426
if (metadataField !=
445427
widget.metadataFields!.last) {

0 commit comments

Comments
 (0)