How to add Multiple Floating button in Stack Widget in Flutter

后端 未结 7 1280
终归单人心
终归单人心 2021-02-04 03:09

In flutter one view over another view using Stack Widget. It\'s work fine. Now I need to added two floating button left and right side of bottom of screen. I added one button ri

7条回答
  •  我在风中等你
    2021-02-04 03:48

    Don't forget to set "heroTag: null," for each floating action button. otherwise you'll get a black screen!

    Stack(
      children: [
        Align(
          alignment: Alignment.bottomLeft,
          child: FloatingActionButton(
                    heroTag: null,
                 ...),
        ),
        Align(
          alignment: Alignment.bottomRight,
          child: FloatingActionButton(
                    heroTag: null,
                 ...),
        ),
      ],
    )
    

提交回复
热议问题