I am a complete newbie in Flutter, but I already like it. The question is: why is the column not expanding to the full height?
code is on gist.github
A Column widget is flexible - it will try to take up as much space as it needs but no more. If you want it to take up all availible space, then wrap it in an Expanded widget. This only works if the Column is inside another Flex widget, as Expanded can only be placed inside a Flex widget.
You can make the children of Row widget, expand to the available horizontal space. All you need to do is, wrap each child of Row widget around Expanded widget.
Using an Expanded widget makes a child of a Row, Column, or Flex expand to fill the available space along the main axis (e.g., horizontally for a Row or vertically for a Column). If multiple children are expanded, the available space is divided among them according to the flex factor.
A Column widget is flexible - it will try to take up as much space as it needs but no more. If you want it to take up all availible space, then wrap it in an Expanded widget.
createChildren() { return [ Image.network( testImg, height: imageSize, width: imageSize, ), Padding(padding: EdgeInsets.only(left: 16.0)), Expanded(child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ boldText("Some title"), Text("Address"), Text("Description") ], ), ), ]; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With