final TextEditingController _textController = new TextEditingController();
TextField(
controller: _textController,
decoration: InputDecoration(
hintText: "Username",
suffixIcon: IconButton(
onPressed: () {
setState(() {
_textController.clear();
});
},
)),
)