2

I have a row with 2 children, 1 child is a column containing another 2 items, and the second-row item has an expanded widget with a button inside it. I'm trying to make both row items full width.

I added an expanded widget to both children. The result for the row child with only 1 item worked perfectly, but the result of the row item that had a nested column there, the expanded widget made its height full screen, while keeping the width small.

How can I make both row childrens width 50% and their height 100px?

Here are the results I would like to have: enter image description here

This is what I'm getting: enter image description here

Jessica
  • 9,379
  • 14
  • 65
  • 136

1 Answers1

5

You could do something like this..

Row(
      children: [
        Expanded(
          child: Column(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              Text('Some other text'),
              RaisedButton(
                child: Text('Button'),
                onPressed: (){},
              ),
            ],
          ),
        ),
        Expanded(
          child: RaisedButton(
            child: Text('Button'),
            onPressed: (){},
          ),
        ),
      ],
    )
Jigar Patel
  • 4,953
  • 1
  • 12
  • 20