Optional validator for the entered code. Returns error message if invalid.
final String? Function(String value)? validator;