You can achieve this by using the InputDecoration class to customize the appearance of your TextField. Here's an example:
TextField(
decoration: InputDecoration(
hintText: "Enter your text here",
border: InputBorder.none,
focusedBorder: InputBorder.none,
enabledBorder: InputBorder.none,
errorBorder: InputBorder.none,
disabledBorder: InputBorder.none,
),
);
By setting all the borders to InputBorder.none, you can remove the underline from your TextField. The hintText will still be visible as expected.