diff --git a/packages/smooth_app/ios/Podfile.lock b/packages/smooth_app/ios/Podfile.lock index 2ab801d5e76..f04650147d5 100644 --- a/packages/smooth_app/ios/Podfile.lock +++ b/packages/smooth_app/ios/Podfile.lock @@ -82,13 +82,13 @@ PODS: - qr_code_scanner (0.2.0): - Flutter - MTBBarcodeScanner - - Sentry (7.9.0): - - Sentry/Core (= 7.9.0) - - Sentry/Core (7.9.0) + - Sentry (7.10.2): + - Sentry/Core (= 7.10.2) + - Sentry/Core (7.10.2) - sentry_flutter (0.0.1): - Flutter - FlutterMacOS - - Sentry (~> 7.9.0) + - Sentry (~> 7.10.1) - shared_preferences_ios (0.0.1): - Flutter - url_launcher_ios (0.0.1): @@ -188,8 +188,8 @@ SPEC CHECKSUMS: PromisesObjC: 68159ce6952d93e17b2dfe273b8c40907db5ba58 Protobuf: 235750e4696ff59fb07d949a9dbbc92b3c0700fe qr_code_scanner: bb67d64904c3b9658ada8c402e8b4d406d5d796e - Sentry: 2f7e91f247cfb05b05bd01e0b5d0692557a7687b - sentry_flutter: 7c3cb050dc23563a4ea5db438c83afdb460a2ae6 + Sentry: 7bf9bfe713692cf87812e55f0999260494ba7982 + sentry_flutter: 77ccdac346608b8ce7e428e7284e7a3e4e7f4a02 shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad url_launcher_ios: 839c58cdb4279282219f5e248c3321761ff3c4de diff --git a/packages/smooth_app/lib/generic_lib/widgets/smooth_text_form_field.dart b/packages/smooth_app/lib/generic_lib/widgets/smooth_text_form_field.dart index 44f03db9fd1..abe9e7a162e 100644 --- a/packages/smooth_app/lib/generic_lib/widgets/smooth_text_form_field.dart +++ b/packages/smooth_app/lib/generic_lib/widgets/smooth_text_form_field.dart @@ -14,6 +14,7 @@ class SmoothTextFormField extends StatefulWidget { this.enabled, this.textInputAction, this.validator, + this.onSubmit, this.autofillHints, this.textColor, this.backgroundColor, @@ -21,6 +22,7 @@ class SmoothTextFormField extends StatefulWidget { this.hintTextFontSize, this.prefixIcon, this.textInputType, + this.focusNode, }) : super(key: key); final TextFieldTypes type; @@ -30,12 +32,18 @@ class SmoothTextFormField extends StatefulWidget { final bool? enabled; final TextInputAction? textInputAction; final String? Function(String?)? validator; + + /// takes in a function to run onFieldSubmit action + final void Function(String?)? onSubmit; final Iterable? autofillHints; final Color? textColor; final double? hintTextFontSize; final Color? backgroundColor; final TextInputType? textInputType; + /// takes in the focusNode for the textFormField + final FocusNode? focusNode; + @override State createState() => _SmoothTextFormFieldState(); } @@ -55,10 +63,12 @@ class _SmoothTextFormFieldState extends State { final bool _autocorrect = widget.type == TextFieldTypes.PLAIN_TEXT; return TextFormField( + focusNode: widget.focusNode, keyboardType: widget.textInputType, controller: widget.controller, enabled: widget.enabled, textInputAction: widget.textInputAction, + onFieldSubmitted: widget.onSubmit, validator: widget.validator, obscureText: _obscureText, enableSuggestions: _enableSuggestions, diff --git a/packages/smooth_app/lib/pages/user_management/sign_up_page.dart b/packages/smooth_app/lib/pages/user_management/sign_up_page.dart index 0c06259d9d0..ceaad7ac635 100644 --- a/packages/smooth_app/lib/pages/user_management/sign_up_page.dart +++ b/packages/smooth_app/lib/pages/user_management/sign_up_page.dart @@ -31,6 +31,7 @@ class _SignUpPageState extends State { final TextEditingController _password1Controller = TextEditingController(); final TextEditingController _password2Controller = TextEditingController(); final TextEditingController _brandController = TextEditingController(); + final FocusNode confirmPassword = FocusNode(); bool _foodProducer = false; bool _agree = false; @@ -131,9 +132,17 @@ class _SignUpPageState extends State { } return null; }, + onSubmit: (String? value) { + // Checks if confirm password is equal to password if not then + // move the focus to the confirm password field + if (_password2Controller.text != value) { + FocusScope.of(context).requestFocus(confirmPassword); + } + }, ), const SizedBox(height: space), SmoothTextFormField( + focusNode: confirmPassword, type: TextFieldTypes.PASSWORD, controller: _password2Controller, textInputAction: TextInputAction.next,