首页 文章

Flutter FloatingActionButton和IconButton

提问于
浏览
0

如何在图像中创建 FloatingActionButton

我尝试使用 FloatingActionButton ,但它看起来像一个带圆圈的整个按钮 .

Sample Image

我需要像图像中所示的 IconButton 之类的东西 .

3 回答

  • 1

    IconButton实际上会实现您的目标!

    根据指南,FloatingActionButton将始终提供您在"View in Your Room" Headers 按钮上找到的设计 .

    IconButton(
      icon: Icon(Icons.back),
      onPressed...
    )
    
  • 1

    为此,您可以使用 **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"),
    )
    
  • 0

    您需要使用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 
              },
    ),
    

相关问题