Search code examples
flutterflutter-layoutfloating-action-button

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


I want to add two icons on FAB Flutter, one icon will be a map(onPressed show map) and other icon will trigger showBottomModel. A kind of icon switch based floatingActionBar, I don't know if that is possible or please tell me a work around. Thanks.


Solution

  • You can use flutter_speed_dial package/dependency here or try below code hope its help to you.

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

    Your result screen -> enter image description here