diff --git a/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart b/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart index 8087b8986..480b6875e 100644 --- a/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart +++ b/frontend/mgramseva/lib/screeens/connection_results/search_connection.dart @@ -99,6 +99,11 @@ class _SearchConsumerConnectionState extends State { onChange: (value) => searchConnectionProvider .getdetails(value, 0), key: Keys.searchConnection.SEARCH_PHONE_NUMBER_KEY, + onSubmit: (value){ + searchConnectionProvider.validatesearchConnectionDetails( + context, widget.arguments, (searchConnectionProvider.searchconnection.controllers[1] == false) + ? true : false); + } ), Text( '\n${ApplicationLocalizations.of(context).translate(i18.common.OR)}', @@ -116,6 +121,11 @@ class _SearchConsumerConnectionState extends State { ], onChange: (value) => searchConnectionProvider .getdetails(value, 1), + onSubmit: (value){ + searchConnectionProvider.validatesearchConnectionDetails( + context, widget.arguments, (searchConnectionProvider.searchconnection.controllers[1] == false) + ? true : false); + }, hint: ApplicationLocalizations.of(context) .translate( i18.searchWaterConnection.NAME_HINT), @@ -145,6 +155,11 @@ class _SearchConsumerConnectionState extends State { .searchWaterConnection .OLD_CONNECTION_HINT), key: Keys.searchConnection.SEARCH_OLD_ID_KEY, + onSubmit: (value){ + searchConnectionProvider.validatesearchConnectionDetails( + context, widget.arguments, (searchConnectionProvider.searchconnection.controllers[1] == false) + ? true : false); + } ), Text( '\n${ApplicationLocalizations.of(context).translate(i18.common.OR)}', @@ -166,6 +181,11 @@ class _SearchConsumerConnectionState extends State { .searchWaterConnection .NEW_CONNECTION_HINT), key: Keys.searchConnection.SEARCH_NEW_ID_KEY, + onSubmit: (value){ + searchConnectionProvider.validatesearchConnectionDetails( + context, widget.arguments, (searchConnectionProvider.searchconnection.controllers[1] == false) + ? true : false); + } ), ]), ]))), diff --git a/frontend/mgramseva/lib/screeens/login/login.dart b/frontend/mgramseva/lib/screeens/login/login.dart index 63d0a55d7..f509c846f 100644 --- a/frontend/mgramseva/lib/screeens/login/login.dart +++ b/frontend/mgramseva/lib/screeens/login/login.dart @@ -95,6 +95,7 @@ class _LoginState extends State { maxLength: 10, validator: Validators.mobileNumberValidator, textInputType: TextInputType.phone, + textInputAction: TextInputAction.done, key: Keys.login.LOGIN_PHONE_NUMBER_KEY, ), BuildTextField( @@ -105,6 +106,12 @@ class _LoginState extends State { suffixIcon: buildPasswordVisibility(), maxLines: 1, key: Keys.login.LOGIN_PASSWORD_KEY, + textInputAction: TextInputAction.done, + onSubmit: (value){ + if(buttonStatus){ + saveandLogin(context); + } + }, ), GestureDetector( onTap: () => diff --git a/frontend/mgramseva/lib/widgets/auto_complete_view.dart b/frontend/mgramseva/lib/widgets/auto_complete_view.dart index 1b9a2f7d6..125986876 100644 --- a/frontend/mgramseva/lib/widgets/auto_complete_view.dart +++ b/frontend/mgramseva/lib/widgets/auto_complete_view.dart @@ -92,6 +92,7 @@ class AutoCompleteView extends StatelessWidget { textFieldConfiguration: TextFieldConfiguration( inputFormatters: inputFormatter, keyboardType: textInputType ?? TextInputType.text, + textInputAction: TextInputAction.done, enabled: (isEnabled ?? true), controller: controller, style: TextStyle( @@ -106,6 +107,7 @@ class AutoCompleteView extends StatelessWidget { suggestionsCallback: (pattern) async { return await callBack(pattern); }, + minCharsForSuggestions: 1, itemBuilder: listTile, onSuggestionSelected: onSuggestionSelected, validator: isRequired == null || !isRequired! diff --git a/frontend/mgramseva/lib/widgets/text_field_builder.dart b/frontend/mgramseva/lib/widgets/text_field_builder.dart index 3e6592b23..6cbc4d336 100644 --- a/frontend/mgramseva/lib/widgets/text_field_builder.dart +++ b/frontend/mgramseva/lib/widgets/text_field_builder.dart @@ -36,6 +36,7 @@ class BuildTextField extends StatefulWidget { final bool? isFilled; final Widget? suffixIcon; final Key? key; + final TextInputAction? textInputAction; BuildTextField(this.labelText, this.controller, {this.input = '', @@ -65,7 +66,7 @@ class BuildTextField extends StatefulWidget { this.requiredMessage, this.autoValidation, this.suffixIcon, - this.key}); + this.key, this.textInputAction}); @override State createState() => _BuildTextField(); @@ -90,6 +91,7 @@ class _BuildTextField extends State { : true, controller: widget.controller, keyboardType: widget.textInputType ?? TextInputType.text, + textInputAction: widget.textInputAction??TextInputAction.done, inputFormatters: widget.inputFormatter, autofocus: false, maxLength: widget.maxLength, @@ -153,7 +155,9 @@ class _BuildTextField extends State { )), suffixIcon: widget.suffixIcon ), - onChanged: widget.onChange)); + onChanged: widget.onChange, + onFieldSubmitted: widget.onSubmit, + )); // Label Text Widget textLabelwidget = Wrap(direction: Axis.horizontal, children: [