Update lib/screens/manage_collection_screen.dart
add email regex Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
94e0ab436b
commit
05bdd281b6
1 changed files with 8 additions and 1 deletions
|
|
@ -167,10 +167,17 @@ class _ManageCollectionScreenState extends State<ManageCollectionScreen> {
|
|||
|
||||
if (result != true) return;
|
||||
|
||||
final email = emailCtrl.text.trim();
|
||||
final emailRegex = RegExp(r'^[^@\s]+@[^@\s]+\.[^@\s]+$');
|
||||
if (!emailRegex.hasMatch(email)) {
|
||||
showGlobalSnackBar('Please enter a valid email address.', isError: true);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
await CollectionService.inviteByEmail(
|
||||
collectionId: _collection.id,
|
||||
email: emailCtrl.text.trim(),
|
||||
email: email,
|
||||
);
|
||||
showGlobalSnackBar('Member invited!');
|
||||
_loadMembers();
|
||||
|
|
|
|||
Loading…
Reference in a new issue