Home > Software engineering >  How to change text in textformfield in flutter conatct picker
How to change text in textformfield in flutter conatct picker

Time:10-07

I have Name from contact is set

CodePudding user response:

/// your code

TextEditingController _phn = TextEditingController();

_phn = contact.phoneNumber!.number
    .removeAllWhiteSpace()
    .replaceFirst(' 91', '')
    .toString();

/// Modify as

_phn.text = contact.phoneNumber!.number
    .removeAllWhiteSpace()
    .replaceFirst(' 91', '')
    .toString();
  • Related