Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

smartAuth integration or isNotValid editing access #359

Open
aymaalo opened this issue Nov 19, 2022 · 0 comments
Open

smartAuth integration or isNotValid editing access #359

aymaalo opened this issue Nov 19, 2022 · 0 comments

Comments

@aymaalo
Copy link

aymaalo commented Nov 19, 2022

Problem:
I would like to add smartAuth requestHint() method to my authentication process. But everytime I call controller.text and apply the value I received from requestHint, later, when i call formKey.currentState!.validate() it returns that the field is not valid (the format of the input is the same as when I type if with the keyboard).

final smartAuth = SmartAuth();
final res = await smartAuth.requestHint(
  isPhoneNumberIdentifierSupported: true,
  isEmailAddressIdentifierSupported: false,
  showCancelButton: true,
);
if (res != null) {
  final PhoneNumber phone = await PhoneNumber.getRegionInfoFromPhoneNumber(res.id);
  String parsableNumber = await PhoneNumber.getParsableNumber(phone);
  phoneNumberController..text = parsableNumber ?? '';
}

Cause:
This issue is due to bool isNotValid = true; (line 140 of intl_phone_number_input/lib/src/widgets/input_widget.dart (I tried to change manually this value to false in the file, I had no issue so the problem comes from here)).
This value is not accessible from the parents and can only be changed after a human interaction. Maybe you could create a custom TextInputController that have a method that can edit this value manually from parents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant