如何在 Flutter 中的 FAB 上添加两个图标和多个操作?

How do I add two icons and multiple actions on a FAB in Flutter?

我想在 FAB Flutter 上添加两个图标,一个图标是地图(onPressed 显示地图),另一个图标将触发 showBottomModel。一种基于 floatingActionBar 的图标切换,我不知道这是否可行,或者请告诉我解决方法。谢谢。

您可以使用 flutter_speed_dial package/dependency here 或尝试以下代码希望对您有所帮助。

   floatingActionButton: Row(
    mainAxisAlignment: MainAxisAlignment.end,
    children: [
      FloatingActionButton(
        onPressed: () => {},
        child: Icon(Icons.person),
      ),
      FloatingActionButton(
        onPressed: () => {},
        child: Icon(Icons.home),
      ),
    ]
  ),

您的结果屏幕 ->