0

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 Answer 1

1

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,
                    ),
                  )
                ],
              ),
Sign up to request clarification or add additional context in comments.

4 Comments

If you add Scrollable widget on top of Column, Spacer will complain about unbound constraints
That is true indeed, but its not the case in his code i think.
Its another issue, heppens when trying to use Spacer inside Scrollable widget. Do you really want to make full screen dialog?
Thank you guys for help a lot. But how do I manage it in case you mentioned? If my top level widget is for example SingleChildScrollView Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.