flutter TextButton.icon 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: flutter textbutton.icon

TextButton.icon(
            icon: Icon(Icons.camera),
            label: Text('Take A Photo'),
            onPressed: () {},
          )

Example 3: flutter raised button with icon

FlatButton.icon(onPressed: null, icon: null, label: null);
RaisedButton.icon(onPressed: null, icon: null, label: null);

Tags: