From 538f7c45171564c89696cc5bcf98a709457c001c Mon Sep 17 00:00:00 2001 From: Ben Corman Date: Tue, 15 Oct 2024 20:15:02 -0700 Subject: [PATCH] Add autoFormValidation to MetaDataField (#125) Remove hardcoded styling for BooleanMetaDataField to prevent it from overriding an app's ThemeData --- lib/src/components/supa_email_auth.dart | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/lib/src/components/supa_email_auth.dart b/lib/src/components/supa_email_auth.dart index eca652a..2856212 100644 --- a/lib/src/components/supa_email_auth.dart +++ b/lib/src/components/supa_email_auth.dart @@ -364,8 +364,6 @@ class _SupaEmailAuthState extends State { : null, builder: (FormFieldState field) { final theme = Theme.of(context); - final isDark = - theme.brightness == Brightness.dark; return Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -389,24 +387,6 @@ class _SupaEmailAuthState extends State { contentPadding: const EdgeInsets.symmetric( horizontal: 4.0), - activeColor: theme.colorScheme.primary, - checkColor: theme.colorScheme.onPrimary, - tileColor: isDark - ? theme.inputDecorationTheme.fillColor - : null, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(4), - side: BorderSide( - color: field.hasError - ? theme.colorScheme.error - : theme - .inputDecorationTheme - .border - ?.borderSide - .color ?? - theme.dividerColor, - ), - ), ), if (field.hasError) Padding( @@ -440,6 +420,8 @@ class _SupaEmailAuthState extends State { prefixIcon: metadataField.prefixIcon, ), validator: metadataField.validator, + autovalidateMode: + AutovalidateMode.onUserInteraction, onFieldSubmitted: (_) { if (metadataField != widget.metadataFields!.last) {