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

The logic is incorrect in the section for setting the country code. #47

Open
tmtit opened this issue Jul 9, 2024 · 5 comments
Open

Comments

@tmtit
Copy link

tmtit commented Jul 9, 2024

I think this logic doesn't seem quite right, can you confirm it? The line assigning number in the if statement has no effect.
Screenshot 2024-07-09 at 15 02 28

@amorenew
Copy link
Owner

amorenew commented Jul 9, 2024

I am not sure if it is right or not, I wrote it long time ago

@tmtit
Copy link
Author

tmtit commented Jul 9, 2024

I see
number = countryPhonePrefix + telephonyManager.getLine1Number().substring(1);
in the if block
if (telephonyManager.getLine1Number().startsWith("0")).
It seems ineffective because right after that, number is reassigned with
number = telephonyManager.getLine1Number();
Could you please check again? Thank you for taking the time.

@amorenew
Copy link
Owner

amorenew commented Jul 9, 2024

yes, that makes sense it is a useless assignment
You’re are right

@tmtit
Copy link
Author

tmtit commented Jul 9, 2024

Does that significantly affect the logic or result in the loss of any features? If I add an else statement to reassign the number, will it have a big impact? Thank you for your time.

@amorenew
Copy link
Owner

amorenew commented Jul 9, 2024

No it was a logic to add the country code
I should provide the country code in a separate function so native doesn’t control it but the dart side
Anyway that if statement wasn’t working before

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

2 participants