如何在图像中创建 FloatingActionButton ?
FloatingActionButton
我尝试使用 FloatingActionButton ,但它看起来像一个带圆圈的整个按钮 .
我需要像图像中所示的 IconButton 之类的东西 .
IconButton
IconButton实际上会实现您的目标!
根据指南,FloatingActionButton将始终提供您在"View in Your Room" Headers 按钮上找到的设计 .
IconButton( icon: Icon(Icons.back), onPressed... )
为此,您可以使用 **actions ** property of appbar to put icons on the right side of title and leading 属性放置一个前导图标 .
appbar: new AppBar( leading: new Icon(Icons.search), actions: <Widget>[ new Icon(Icons.search), new Icon(Icons.search), ], title: new Text("title"), )
您需要使用IconButton,如下所示
// Icon Button new IconButton( icon: new Icon(Icons.favorite), tooltip: 'Facorite icon', color: Colors.blue, //set color which you want onPressed: () { // Do your work }, ),
3 回答
IconButton实际上会实现您的目标!
根据指南,FloatingActionButton将始终提供您在"View in Your Room" Headers 按钮上找到的设计 .
为此,您可以使用 **actions ** property of appbar to put icons on the right side of title and leading 属性放置一个前导图标 .
您需要使用IconButton,如下所示