1

I do a row for many button that can do scroll vertical, but i need some space between button, so i add Spacer() for create a space

            SingleChildScrollView(
              .....
              child: Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.center,
                    children: [
                      TextButton(
                        ....
                      ),
                      Spacer(),
                      TextButton(
                        ....
                      ),
                    ],
                  )
                ],
              ),
            )

After I add syntax Spacer() there, I got this Error Error screenshot,

2 Answers2

2

I change my Row() to Wrap(), then I add spacing: from wrap widget

Wrap(
  spacing: 100,
  ....
)

and Done, Thx everyone

0

Try to wràp your SingleChildScrollView with Container that has a preferred size, e.g. Container(width: 400, height 400, child: SingleChilScrollView....). If it doesn't work, use SizedBox or Divider instead of Spacer.

Muhammet
  • 89
  • 6