-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for displaying sign-in or sign-up initially #107
Support for displaying sign-in or sign-up initially #107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I love it! Just had one little thing.
Co-authored-by: Tyler <[email protected]>
Sure, definitely! |
Would you be able to update the variable name on other places that it's used as well? |
@@ -109,6 +112,7 @@ class SupaEmailAuth extends StatefulWidget { | |||
this.metadataFields, | |||
this.extraMetadata, | |||
this.localization = const SupaEmailAuthLocalization(), | |||
this.isSigningIn = true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.isSigningIn = true, | |
this.isInitiallySigningIn = true, |
/// Focus node for email field | ||
final FocusNode _emailFocusNode = FocusNode(); | ||
|
||
@override | ||
void initState() { | ||
super.initState(); | ||
_isSigningIn = widget.isSigningIn; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_isSigningIn = widget.isSigningIn; | |
_isInitiallySigningIn = widget.isInitiallySigningIn; |
@@ -120,21 +124,20 @@ class _SupaEmailAuthState extends State<SupaEmailAuth> { | |||
final _emailController = TextEditingController(); | |||
final _passwordController = TextEditingController(); | |||
late final Map<MetaDataField, TextEditingController> _metadataControllers; | |||
late bool _isSigningIn; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
late bool _isSigningIn; | |
late bool _isInitiallySigningIn; |
Closing in favor of #116 |
What kind of change does this PR introduce?
feature
What is the current behavior?
We always display the login form by default
What is the new behavior?
We added a parameter to control whether sign up for or sign-in form is being displayed initially.
Additional context
From the business perspective, depending on the UX flow, you should be able to present either login or sign-up. For example, a page with CTA "try for free, no credit card required" should redirect to a sign-up form, not a login form that requires one additional unnecessary step from the user.