Flutter/Dart: Mixed topics


Button types

IconButton

Here is an example of the usage of the buttons of the type IconButton:
...
class _MyItemsPageState extends State<MyItemsPage> {
  @override
  Widget build(BuildContext context) {
    var button =  IconButton(icon:  const Icon(Icons.arrow_back), onPressed: _onButtonPressed);
    return Scaffold(
      appBar: AppBar(
        title:  Text(widget.title),
      ),
      body:  Container(
        child:  Column(
          children: <Widget>[
            const Text('Item1'),
            const Text('Item2'),
            button,
          ],
        ),
      ),
      floatingActionButton:  FloatingActionButton(
        onPressed: _onButtonPressed,
        tooltip: 'Backward',
        child:  const Icon(Icons.navigate_before),
      ),
    );
  }

...

  void _onButtonPressed() {
    Navigator.pop(context);
  }
...
The button would look like this on the GUI: