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();