flutter iconbutton with text code example
Example 1: flutter textfield with icon onclick
TextField(
controller: _controller,
decoration: InputDecoration(
hintText: "Enter a message",
suffixIcon: IconButton(
onPressed: () => _controller.clear(),
icon: Icon(Icons.clear),
),
),
)
Example 2: onpressed icon flutter
final VoidCallback onPressed