-
Notifications
You must be signed in to change notification settings - Fork 72
feat: Add prefilled email, password to SupaEmailAuth #143
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
Open
maurovanetti
wants to merge
9
commits into
supabase-community:main
Choose a base branch
from
maurovanetti:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
69a229d
feat: Add prefilled email, password to SupaEmailAuth
maurovanetti f28878e
Initial plan
Copilot 0c36bc5
Add enableAutomaticFormSubmission flag to all auth components
Copilot 035b438
Apply dart format to code
Copilot 97963d3
Add documentation for enableAutomaticFormSubmission feature
Copilot 9b8f3bd
Apply final dart format
Copilot 200264b
Refactor: extract form submission logic into separate methods
Copilot 550e270
Merge pull request #2 from maurovanetti/copilot/add-config-flag-preve…
maurovanetti 89c703b
feat: Add autosubmit flag
maurovanetti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import 'package:flutter/foundation.dart'; | ||
import 'package:flutter/gestures.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:supabase_auth_ui/supabase_auth_ui.dart'; | ||
|
||
import 'constants.dart'; | ||
|
||
class SignInPrefilled extends StatelessWidget { | ||
const SignInPrefilled({Key? key}) : super(key: key); | ||
@override | ||
Widget build(BuildContext context) { | ||
void navigateHome(AuthResponse response) { | ||
Navigator.of(context).pushReplacementNamed('/home'); | ||
} | ||
|
||
return Scaffold( | ||
appBar: appBar('Sign In (Prefilled)'), | ||
body: ListView( | ||
padding: const EdgeInsets.all(24.0), | ||
children: [ | ||
SupaEmailAuth( | ||
prefilledEmail: "[email protected]", | ||
prefilledPassword: "password", | ||
redirectTo: kIsWeb ? null : 'io.supabase.flutter://', | ||
onSignInComplete: navigateHome, | ||
onSignUpComplete: navigateHome, | ||
metadataFields: [ | ||
MetaDataField( | ||
prefixIcon: const Icon(Icons.person), | ||
label: 'Username', | ||
key: 'username', | ||
validator: (val) { | ||
if (val == null || val.isEmpty) { | ||
return 'Please enter something'; | ||
} | ||
return null; | ||
}, | ||
), | ||
BooleanMetaDataField( | ||
label: 'Keep me up to date with the latest news and updates.', | ||
key: 'marketing_consent', | ||
checkboxPosition: ListTileControlAffinity.leading, | ||
), | ||
BooleanMetaDataField( | ||
key: 'terms_agreement', | ||
isRequired: true, | ||
checkboxPosition: ListTileControlAffinity.leading, | ||
richLabelSpans: [ | ||
const TextSpan(text: 'I have read and agree to the '), | ||
TextSpan( | ||
text: 'Terms and Conditions', | ||
style: const TextStyle( | ||
color: Colors.blue, | ||
), | ||
recognizer: TapGestureRecognizer() | ||
..onTap = () { | ||
// Handle tap on Terms and Conditions | ||
}, | ||
), | ||
], | ||
), | ||
], | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The changelog entry is missing documentation of the main feature mentioned in the PR title - the addition of
prefilledEmail
andprefilledPassword
parameters to SupaEmailAuth.Copilot uses AI. Check for mistakes.