I have a question about trim function. when I am using trim it's not working. when I am adding white space and then used the trim function but still my validation is true. instead of trim has to remove all white space. Hope you understand the question. thank you in advance.
Widget _buildUserNameField() {
return EnsureVisibleWhenFocused(
focusNode: _emailFocusNode,
child: TudoEmailWidget(
focusNode: _emailFocusNode,
prefixIcon: Icon(Icons.email),
labelText: AppConstantsValue.appConst['login']['email']['translation'],
validator: Validators().validateEmail,
onSaved: (val) => _username = val.trim(),
),
);
}