better_email_validator 0.0.2 better_email_validator: ^0.0.2 copied to clipboard
A robust and customizable email validation library for Dart and Flutter projects. Inspired by isEmail function from validator JavaScript library.
example/better_email_validator_example.dart
import 'package:better_email_validator/better_email_validator.dart';
void main() {
// Basic usage
print(isEmail('test@example.com')); // true
print(isEmail('invalid-email')); // false
// Advanced usage with options
final options = EmailOptions(
allowDisplayName: true,
requireTld: true,
allowIpDomain: false,
domainSpecificValidation: true,
);
print(isEmail('John Doe <john@example.com>', options: options)); // true
print(isEmail('user@192.168.1.1', options: options)); // false
}