validate method

  1. @override
String? validate(
  1. String input
)
override

A function that returns an error message string to display if the input s not pass a validation test and returns null otherwise.

Implementation

@override
String? validate(String input) => input.contains(RegExp(r'(?=.*[@#$%^&+=])'))
    ? null
    : "At least one character among the following is required: @#\$%^&+= ";