简体   繁体   中英

How to align widgets to top in Column class?

Which parameter should I change to fit the values fom "childen : [...]" to the top in UI? (Currently they are filling all free spase in the Container). Thank you in advance for explanation!! Code snippet:

return new Container(
  child: new Column (
    crossAxisAlignment: CrossAxisAlignment.start,
    mainAxisSize: MainAxisSize.min,


    children: <Widget>[
      new Text('\$$priceUsd\n'),
  new Text('1 hour: $percentChange1h%',
    style: new TextStyle(
        color: changeColor),


    )],
  )
);

在此输入图像描述

just set the main axis alignment to the start return new Container(

  child: new Column (
    crossAxisAlignment: CrossAxisAlignment.start,
    mainAxisAlignment: MainAxisAlignment.start,
    mainAxisSize: MainAxisSize.min,


    children: <Widget>[
      new Text('\$$priceUsd\n'),
  new Text('1 hour: $percentChange1h%',
    style: new TextStyle(
        color: changeColor),


    )],
  )
);

在此输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM