I want to add fixed not editable text to TextField
For example: when the user enter's Name after name there should be fixed text [user]
the result should be: Alexandra[user]
When user typing the name, fixed word [user] must be always there!
I hope you got what I want any related topics links will be helpful!
I tried similar Initial text but its editable by the user, mine should be fixed
Controller: TextEditingController(text: "Initial Text here"),
My TextField now:
TextField(
decoration: InputDecoration(
labelText: ENTER_NAME,
labelStyle: GoogleFonts.poppins(
color: LIGHT_GREY_TEXT,
fontWeight: FontWeight.w400
),
border: UnderlineInputBorder(),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: LIGHT_GREY_TEXT)
),
errorText: isNameError ? ENTER_NAME : null,
),
style: GoogleFonts.poppins(
color: BLACK,
fontWeight: FontWeight.w500
),
onChanged: (val){
setState(() {
name = val;
isNameError = false;
});
},
),
