isValidAppPassword function
Checks if a given application password is valid based on a predefined regular expression pattern.
The expected format is xxxx-xxxx-xxxx-xxxx
, where each x
is a
lowercase letter or a digit.
Example usage:
bool isValid = isValidAppPassword('abcd-1234-wxyz-7890'); // returns true
bool isNotValid = isValidAppPassword('ABC-1234-XYZ'); // returns false
appPassword
: The application password string to be validated.
Returns true
if appPassword
is valid, otherwise returns false
.
Implementation
bool isValidAppPassword(final String appPassword) =>
RegExp(_regexAppPassword).hasMatch(appPassword);