How to add Multiple Floating button in Stack Widget in Flutter

后端 未结 7 1283
终归单人心
终归单人心 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:37

    You can also use something like this using location as centerDocked so that you don't get that weird left alignment.

    floatingActionButtonLocation:
                  FloatingActionButtonLocation.centerDocked,
              floatingActionButton: Padding(
                padding: const EdgeInsets.all(8.0),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    FloatingActionButton(
                      onPressed: () {},
                      child: Icon(Icons.navigate_before),
                    ),
                    FloatingActionButton(
                      onPressed: () {},
                      child: Icon(Icons.navigate_next),
                    )
                  ],
                ),
              )
    

提交回复
热议问题