actions property
A list of Widgets to display in a row after the title widget.
Typically these widgets are IconButtons representing common operations. For less common operations, consider using a PopupMenuButton as the last action.
The actions become the trailing component of the NavigationToolbar built by this widget. The height of each action is constrained to be no bigger than the toolbarHeight.
To avoid having the last action covered by the debug banner, you may want to set the MaterialApp.debugShowCheckedModeBanner to false.
{@tool snippet}
Scaffold(
body: CustomScrollView(
primary: true,
slivers: <Widget>[
SliverAppBar(
title: const Text('Hello World'),
actions: <Widget>[
IconButton(
icon: const Icon(Icons.shopping_cart),
tooltip: 'Open shopping cart',
onPressed: () {
// handle the press
},
),
],
),
// ...rest of body...
],
),
)
{@end-tool}
Implementation
final List<Widget>? actions;