jaumard / sms_autofill

Flutter plugin to provide SMS code autofill support
MIT License
282 stars 174 forks source link

[PhoneFieldHint] The given phoneNumber is empty. Please set a non-empty phone number #99

Closed zohaib304 closed 3 years ago

zohaib304 commented 3 years ago

PhoneFieldHint displays the phone number in the text field. but on submit firebase auth show exception.

Unhandled Exception: [firebase_auth/unknown] The given phoneNumber is empty. Please set a non-empty phone number with #setPhoneNumber()

here is my PhoneFieldHint

PhoneFieldHint(
    controller: _phoneController,
    decoration: InputDecoration(
    fillColor: Color(0xffF5F7F9),
    filled: true,
    hintText: "+92 123 4567890",
    helperText: "Please enter your mobile number",
    border: InputBorder.none,
    focusedBorder: InputBorder.none,
    ),
),
jaumard commented 3 years ago

What append if before sending to firebase you print the value of _phoneController ? because I see nothing wrong here, if value is on the field then it should be on _phoneController and if it is it mean you have a bug on your side.

zohaib304 commented 3 years ago

value of `_phoneController' not printing on the console as well.

zohaib304 commented 3 years ago

I just create a new project and still showing an empty string.

afsar47 commented 3 years ago

you can add this line on your PhoneFieldHint Class Screen Shot 2021-04-10 at 4 57 01 AM 2

jaumard commented 3 years ago

good catch @afsar47! Thanks! It's fixed on master and will be release with null safety, closing for now