GitHub

    Table of contents

  1. 示例
  2. 相关链接

IconButton

Edit this page

A material design icon button.

示例

double _volume = 0.0;

// ...

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

相关链接