I am tying to use regex for validation email and password in flutter web project, here is the part of the code
TextField(
onChanged: (text) {
bool passValid =
RegExp(r'^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9]).{6,}$')
.hasMatch(text);
setState(() {
repasswordVal = passValid;
});
print(repasswordVal);
},
controller: _repassword,
decoration: new InputDecoration(
suffixIcon: GestureDetector(
onTap: () {
setState(() {
_isHideRePassword = !_isHideRePassword;
});
},
),
labelText: "Re-enter Password",
fillColor: Colors.white,
border: new OutlineInputBorder(
borderSide: new BorderSide(color: Colors.black),
),
)),
but when I turning on the capslock keyboard, I always get this exception actually I can ignore this exception because the project can still run correctly, but is there any solution to prevent this exception?