Is there a way to simply turn hintText into an actual value? I'm getting ${widget.message} from another class (previous screen where a person inputs a given value) and then want it to be hardcoded. I tried with using initialValue in TextFormField, but can't get it to work.
When writting initialValue: ${widget.message}, before the controller, I get " Failed assertion: line 196 pos 15: 'initialValue == null || controller == null': is not true."
TextFormField(
controller: nameController,
validator: (value){
if(value.isEmpty){
return "Enter Valid Name";
}else{
return null;
}
},
decoration: InputDecoration(
hintText: "${widget.message}",
suffixIcon: IconButton(
onPressed: () => nameController.clear(),
icon: Icon(Icons.clear),
),
),
),