Flutter - the top alignment text in the container

I try to leave the text $at the top of the container, but even with the FractionalOffset(1.0, 0.0)text $continues in the middle of the container.

What can be done to leave $at the top of the container?

  body: new Card(
    child: new Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        new Container(
          padding: new EdgeInsets.only(top: 16.0),
          child: new Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              new Container(
                alignment: new FractionalOffset(1.0, 0.0),
                child: new Text(
                  '\$  ',
                  style: new TextStyle(
                    fontSize: 20.0,
                    fontFamily: 'Roboto',
                    color: new Color(0xFF26C6DA),
                  )
                )
              ),               
              new Text(
                '3,435.23',
                style: new TextStyle(
                  fontSize: 35.0,
                  fontFamily: 'Roboto',
                  color: new Color(0xFF26C6DA)
                ),
              )                 
            ],
          ),
        ),            
        new Text('general balance'),
      ],
    ),
  ),

enter image description here

+4
source share
1 answer

Try to give Rowa CrossAxisAlignment CrossAxisAlignment.start. Is that what you had in mind?

screenshot

 body: new Card(
    child: new Column(
      mainAxisSize: MainAxisSize.min,
      children: <Widget>[
        new Container(
          padding: new EdgeInsets.only(top: 16.0),
          child: new Row(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              new Text(
                '\$  ',
                style: new TextStyle(
                  fontSize: 20.0,
                  fontFamily: 'Roboto',
                  color: new Color(0xFF26C6DA),
                )
              ),
              new Text(
                '3,435.23',
                style: new TextStyle(
                  fontSize: 35.0,
                  fontFamily: 'Roboto',
                  color: new Color(0xFF26C6DA)
                ),
              )
            ],
          ),
        ),
        new Text('general balance'),
      ],
    ),
  ),
+5
source

Source: https://habr.com/ru/post/1679159/


All Articles