isStringValidPassword function
Implementation
bool isStringValidPassword(String password) {
// A simple regex to validate password format (at least 8 characters, at least one letter and one number)
final passwordRegex = RegExp(
r'^(?=.*[a-zA-Z])(?=.*\d)[a-zA-Z\d]{8,}$',
);
return passwordRegex.hasMatch(password);
}