From af55c3c73da8feced0e6c3987aedc310345c3e80 Mon Sep 17 00:00:00 2001 From: SurendarSuri30 Date: Tue, 11 Aug 2026 11:15:35 +0530 Subject: [PATCH] field keyboard enter option implement --- lib/pages/email_verify.dart | 24 +++++++++++++++++ lib/pages/login.dart | 51 +++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) diff --git a/lib/pages/email_verify.dart b/lib/pages/email_verify.dart index f044e70..9ac38a0 100755 --- a/lib/pages/email_verify.dart +++ b/lib/pages/email_verify.dart @@ -1161,8 +1161,32 @@ class _MyEmailVerifyState extends State { .digitsOnly, // ✅ allows only 0–9 ], keyboardType: TextInputType.number, + textInputAction: + TextInputAction.done, showCursor: true, controller: _otpController, + onCompleted: (value) { + if (_isLoading || + _isOtpVerified) { + return; + } + if (_formKey.currentState + ?.validate() == + true) { + verifyOTP(value.trim()); + } + }, + onSubmitted: (value) { + if (_isLoading || + _isOtpVerified) { + return; + } + if (_formKey.currentState + ?.validate() == + true) { + verifyOTP(value.trim()); + } + }, validator: (value) { if (value == null || value.isEmpty) { return 'OTP is required'; diff --git a/lib/pages/login.dart b/lib/pages/login.dart index 5bf5857..841490b 100755 --- a/lib/pages/login.dart +++ b/lib/pages/login.dart @@ -1729,6 +1729,13 @@ class _loginState extends State { emailMobileController, keyboardType: TextInputType.text, + textInputAction: + TextInputAction.done, + onFieldSubmitted: (_) { + if (!_isLoading) { + verifyMobileAndEmailNumber(); + } + }, decoration: const InputDecoration( border: InputBorder.none, @@ -1978,6 +1985,8 @@ class _loginState extends State { keyboardType: TextInputType .emailAddress, + textInputAction: + TextInputAction.next, decoration: InputDecoration( border: @@ -2026,6 +2035,13 @@ class _loginState extends State { passwordController, obscureText: _obscurePassword, + textInputAction: + TextInputAction.done, + onFieldSubmitted: (_) { + if (!_isLoading) { + loginWithUsernameAndPw(); + } + }, textAlignVertical: TextAlignVertical .center, // ✅ THE FIX @@ -2175,6 +2191,15 @@ class _loginState extends State { keyboardType: TextInputType .emailAddress, + textInputAction: + TextInputAction.done, + onFieldSubmitted: (_) { + if (_isLoading || + otpFieldShow) { + return; + } + mailVerify(); + }, decoration: InputDecoration( border: @@ -2261,9 +2286,24 @@ class _loginState extends State { keyboardType: TextInputType .number, + textInputAction: + TextInputAction + .done, showCursor: true, controller: _otpController, + onCompleted: + (_) { + if (!_isLoading) { + otpVerify(); + } + }, + onSubmitted: + (_) { + if (!_isLoading) { + otpVerify(); + } + }, validator: (value) { if (value == @@ -2410,6 +2450,8 @@ class _loginState extends State { obscureText: _resetObscurePassword, onChanged: validatePassword, + textInputAction: + TextInputAction.next, textAlignVertical: TextAlignVertical .center, @@ -2510,6 +2552,15 @@ class _loginState extends State { confirmPasswordController, obscureText: _obscureConfirmPassword, + textInputAction: + TextInputAction.done, + onFieldSubmitted: (_) { + if (_isLoading || + !isPasswordValid) { + return; + } + resetYourPassword(); + }, textAlignVertical: TextAlignVertical .center,