Mosijava
0
Q:

flutter add a icon button

double _volume = 0.0;

// ...

Widget build(BuildContext context) {
  return Column(
    mainAxisSize: MainAxisSize.min,
    children: <Widget>[
      IconButton(
        icon: Icon(Icons.volume_up),
        tooltip: 'Increase volume by 10',
        onPressed: () {
          setState(() {
            _volume += 10;
          });
        },
      ),
      Text('Volume : $_volume')
    ],
  );
}
2

New to Communities?

Join the community