0
votes

Hi I have this widget Tree:

  • Center
    • Padding
      • Column
        • TextField
        • TextField
        • Text
        • Button
        • SizedBox
          • SvgPicture.asset

And I want to put all widgets except SvgPicture(or SizedBox in which is Picture) to middle of screen and only image to center bottom of screen. MainAxisAlignment of Column is center. Output is: enter image description here

Image should be at bottom and other widgets in the middle of screen. Thanks.

1

1 Answers

1
votes

you could use Spacer to achieve this. So your column will look like this :

Column(
                mainAxisSize: MainAxisSize.min,
                children: <Widget>[
                  Spacer(),
                  TextField(),
                  TextField(),
                  Text("Hola"),
                  FlatButton(
                    child: Text("Button"),
                  ),
                  Spacer(),
                  SizedBox(
                    height: 70,
                    child: Container(
                      color: Colors.teal,
                    ),
                  )
                ],
              ),