Description
When a user attempts to share an alarm via the ShareDialog, the email input field strictly validates the email using a regex that does not support hyphens or subdomains in the domain name.
If a user enters an email like hello@my-domain.com or student@cs.university.edu, the regex fails and throws an "Invalid email" Snackbar, completely blocking the user from sharing the alarm.
Steps to Reproduce
- Open the app and create an alarm.
- Tap the Share icon to open the
ShareDialog.
- Tap the
+ icon to add a new user.
- Enter a valid email with a hyphenated domain (e.g.,
test@open-source.org).
- Tap the Add icon.
- Observe the "Invalid email" error Snackbar.
Expected Behavior
The app should accept standard valid email addresses, including those with hyphens in the domain name and multiple subdomains, allowing the user to be added to the IsarDB Saved_Emails table.
Proposed Solution
Update the regular expression in share_dialog.dart to a standard robust email regex that accounts for - and . within the domain grouping.
Description
When a user attempts to share an alarm via the
ShareDialog, the email input field strictly validates the email using a regex that does not support hyphens or subdomains in the domain name.If a user enters an email like
hello@my-domain.comorstudent@cs.university.edu, the regex fails and throws an "Invalid email" Snackbar, completely blocking the user from sharing the alarm.Steps to Reproduce
ShareDialog.+icon to add a new user.test@open-source.org).Expected Behavior
The app should accept standard valid email addresses, including those with hyphens in the domain name and multiple subdomains, allowing the user to be added to the IsarDB
Saved_Emailstable.Proposed Solution
Update the regular expression in
share_dialog.dartto a standard robust email regex that accounts for-and.within the domain grouping.