In flutter you have two different types of text fields, TextField and TextFormField.
Inorder to get a Text inside the TextFIeld or TextFormField, you need to modify your code as below.
For TextField,
TextField(
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Please enter a search term'
),
),
For TextFormField,
TextFormField(
decoration: InputDecoration(
hintText: "First Name"
),
validator: (value) {
if(value.isEmpty) {
return 'Please enter some text';
}
},
),
Hope this is helpful.
Thanks,
Srikanth