isBasicallyValidEmailAddress method

bool isBasicallyValidEmailAddress(
  1. String? email
)

This implements only the most basic checking for an email address's validity -- that it contains an '@' and contains no characters disallowed by RFC 2822. This is an overly lenient definition of validity. We want to generally be lenient here since this class is only intended to encapsulate what's in a barcode, not "judge" it.

Implementation

bool isBasicallyValidEmailAddress(String? email) =>
    email != null &&
    _aTextAlphaNumeric.hasMatch(email) &&
    email.contains('@');