Xavier VZ
Xavier VZ

Reputation: 172

Flutter Row and Column Problems

I am facing problems with Rows in flutter, I want to put my asset at the botton of the container, How can I do that using Row? I tried mainAxisAlignment: MainAxisAlignment.end, and cross.end but is not working...

  Widget build(BuildContext context) {
    double wi = MediaQuery.of(context).size.width;
    return Scaffold(
      body: Container(
        child: Column(
          children: <Widget>[
            Container(
              color: Colors.blue,
              width: wi,
              height: 200,
            ),
            Container(
              width: wi,
              height: 200,
              color: Colors.red,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.end,
                crossAxisAlignment: CrossAxisAlignment.end,
                children: <Widget>[
                  SvgPicture.asset('assets/escapa.svg', semanticsLabel: 'Flask', color: Colors.black, width: 100,height: 100,)
                ]
              ),
              )
          ],
        ),
      ),
    );

svg1

svg2

you can download the asset/image.svg here http://filesharing24.com/d/DVh

Upvotes: 0

Views: 955

Answers (1)

kapil
kapil

Reputation: 121

Container has property alignment use that, you can either use it like this

alignment: Alignment(0.0, 0.0), // this means center, range is from -1 to +1

you would need to set it as Alignment(-1.0, 1.0) or use it like this

alignment: Alignment.bottomRight,

u don't need to play with row or column axis, container property should be enough. play around with either one of the methods to get exact position

Upvotes: 1

Related Questions