Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR DART

flutter textformfield clear value

final TextEditingController _textController = new TextEditingController();
TextField(
          controller: _textController,
          decoration: InputDecoration(
              hintText: "Username",
              suffixIcon: IconButton(
                onPressed: () {
                  setState(() {
                    _textController.clear();
                  });
                },
              )),
        )
Source by fluttertutorial.in #
 
PREVIOUS NEXT
Tagged: #flutter #textformfield #clear
ADD COMMENT
Topic
Name
5+5 =