TF-191 Fix keyboard to email input type when input for Url, Email, To, Cc, Bcc

This commit is contained in:
dab246
2021-10-18 15:21:31 +07:00
committed by Dat H. Pham
parent ececc65a26
commit 1432cb0209
3 changed files with 9 additions and 0 deletions
@@ -10,6 +10,7 @@ class TextFieldBuilder {
bool? _obscureText;
int? _maxLines = 1;
TextEditingController? _textController;
TextInputType? _keyboardType;
void key(Key key) {
_key = key;
@@ -47,6 +48,10 @@ class TextFieldBuilder {
_maxLines = value;
}
void keyboardType(TextInputType? value) {
_keyboardType = value;
}
TextField build() {
return TextField(
key: _key ?? Key('TextFieldBuilder'),
@@ -60,6 +65,7 @@ class TextFieldBuilder {
keyboardAppearance: Brightness.light,
style: _textStyle ?? TextStyle(color: AppColor.textFieldTextColor),
obscureText: _obscureText ?? false,
keyboardType: _keyboardType,
);
}
}
@@ -123,6 +123,7 @@ class EmailAddressComposerWidgetBuilder {
autofocus: prefixEmailAddress == PrefixEmailAddress.to ? true : false,
textStyle: TextStyle(color: AppColor.nameUserColor, fontSize: 14, fontWeight: FontWeight.w500),
cursorColor: AppColor.primaryColor,
inputType: TextInputType.emailAddress,
decoration: InputDecoration(
border: InputBorder.none,
hintText: AppLocalizations.of(_context).hint_text_email_address,
@@ -95,6 +95,7 @@ class LoginView extends GetWidget<LoginController> {
..key(Key('login_url_input'))
..onChange((value) => loginController.setUrlText(value))
..textInputAction(TextInputAction.next)
..keyboardType(TextInputType.emailAddress)
..textDecoration(LoginInputDecorationBuilder()
.setLabelText(AppLocalizations.of(context).prefix_https)
.setPrefixText(AppLocalizations.of(context).prefix_https)
@@ -111,6 +112,7 @@ class LoginView extends GetWidget<LoginController> {
..key(Key('login_username_input'))
..onChange((value) => loginController.setUserNameText(value))
..textInputAction(TextInputAction.next)
..keyboardType(TextInputType.emailAddress)
..textDecoration(LoginInputDecorationBuilder()
.setLabelText(AppLocalizations.of(context).username)
.setHintText(AppLocalizations.of(context).username)